Hi guys,
I want to know the best way to edit a C code and add braces to all control statements that dont have a curly brace. Currently Im thinking of finding control statements and find the ones that dont have a curly brace and add it. The hard part would be the
right place to put the closing curly brace. Of course with some hard code it is possible to do it but I wonder if there is a shortcut to find it.
Here is an example of what Im trying to do:
<pre lang="x-cpp //replace this
int main()
{
if(true)
return 0;
return 1;
}
//with this:
int main()
{
if(true)
{
return 0;
}
return 1;
}[/code]
Thanks for your helps.
<
CPU: Core2 Due E7300 2.66GHz, RAM: 4GB DDR2, OS:Windows 7 Ultimate, HDD: 1TB SATA II, VGA: 1GB ATI , Compiler: VS 2008 Pro Sp1
View the full article
I want to know the best way to edit a C code and add braces to all control statements that dont have a curly brace. Currently Im thinking of finding control statements and find the ones that dont have a curly brace and add it. The hard part would be the
right place to put the closing curly brace. Of course with some hard code it is possible to do it but I wonder if there is a shortcut to find it.
Here is an example of what Im trying to do:
<pre lang="x-cpp //replace this
int main()
{
if(true)
return 0;
return 1;
}
//with this:
int main()
{
if(true)
{
return 0;
}
return 1;
}[/code]
Thanks for your helps.
<
CPU: Core2 Due E7300 2.66GHz, RAM: 4GB DDR2, OS:Windows 7 Ultimate, HDD: 1TB SATA II, VGA: 1GB ATI , Compiler: VS 2008 Pro Sp1
View the full article