tags:

views:

149

answers:

4

It seams very weird to me.I cant really understand whats happening. I had a false on my code,decided to put a part of it on /*...*/ BUT when i run the program... this part of code is also executed!!!

EDIT: well this is the code i put in comments as you can see:

/*int menu()
{ 
 int code;
 while (1)
 {
 // printf("\nGive code:");
 // scanf("%d",&code);

 // int size=0;
 // int i;
 // i=findposD(code);

 // printf("Position of code: %d\n",code);      
// }
//}
*/

As you see I have some 'printf's which ARE RUNNING PROPERLY! I put the whole on /.../ an then each line in order to be sure...its still the same

+5  A: 

Wild guess - you didn't recompile it.

Vilx-
@Vilx: wish i hadnt...but no i recompiled it
FILIaS
@FILIaS: Maybe the recompiled version failed to compile and so the executable was not recreated. So you're still running the old one.
nico
+1  A: 

Check if there is a space between the / and *.

Also check whether you might have nested comments.

John Smith
nested comments wont compile
kaustubh
+kaustubh. @John Smith: there is no gap. No nested comments
FILIaS
+3  A: 

What sort of environment are you running in?

Is it possible you edited the wrong file, or didn't save your edits, something like that?

Are you 100% sure you are compiling the code you edited? Have you checked the timestamp on the obj and exe files to make sure they are being rebuilt?

Steve Haigh
ubuntu 9.04 gedit No i didnt edit the wrong file. i compiled the edited one. timestamp?
FILIaS
timestamp - what is the exact date and time the executable was built?
Steve Haigh
+1  A: 

Your compiler will never compile comments. It will never compile anything which is not the language it is supposed to compile.

guidj0s
agreed! that's why it seems weird to me
FILIaS