Skip to content

convert C++ codes which without brace to standard C++ codes

Notifications You must be signed in to change notification settings

zhonhel/cplusplus-without-brace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 

Repository files navigation

cplusplus-without-brace

A program that convert C++ codes which without brace to standard C++ codes.

Complie

No third-part library used, directly use C++ complier to complie.

Usage

./cwb2sc   your_file.cwb

Output

your_file.cpp

Explanation

The cwb file is actually just txt format file.

I define cwb file which contains C++ codes without brace, and the codes look like this:

while (pscF.getline(lastLine, 5000))
	for (i = 0; i < strlen(lastLine); i++)
		if (line[i] != ' ' && line[i] != '\t') break;
	if (i == strlen(lastLine))
		continue;
	else
		lastLineSpaceNum = i;
		break;

As you can see, this type of codes cannot be complied by compiler, so can use this program to convert these codes to standard C++ codes:

while (pscF.getline(lastLine, 5000)){
	for (i = 0; i < strlen(lastLine); i++){
		if (line[i] != ' ' && line[i] != '\t') break;}
	if (i == strlen(lastLine)){
		continue;}
	else{
		lastLineSpaceNum = i;
		break;}}

About

convert C++ codes which without brace to standard C++ codes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages