Thursday, July 30, 2009

In my turbo C++...as i complie my program...the error comes as the Declaration syntax error,plz help 2 fix it.

is this problem because of my directories...or is it an error in the IOSTREAM....


there were many Declaration errors only for iostream...

In my turbo C++...as i complie my program...the error comes as the Declaration syntax error,plz help 2 fix it.
The 1st line with the include is incorrect. Instead of 'Include' it should be 'include' Remember that the compiler is case-sensitive.


Which compiler are you using and for which operating system? The screen clearing function, clrscr() is defined in CONIO.H in my Borland C++ DOS compiler, but that function doesn't exist in CONIO.H on my Microsoft C++ Windows compiler. If the 'clrscr();' line is giving you an 'undeclared identifier' error, then remove it.





The rest of the program is fine. Make sure that the compiler is set to create a C++ program, not C. Save your source file with the .cpp file extension. You might also want to look through the compiler settings.
Reply:well it's pretty difficult to say any thing without seeing the actual code.....if you would have added your code right here then it would be a lot easier to handle...


any way the declaration errors mainly occur that when u ommit to declare a variable or u declare it with wrong data type..etc.....
Reply:sign your variants one by one . and give to them zero value
Reply:turbo c++ command different from visual c++ command


and maybe you want this:-





#include%26lt;conio.h%26gt;


#include%26lt;stdio.h%26gt;


void main()


{


clrscr();


int a,b,c;


printf("\n enter a value for a:");


scanf("%i",%26amp;a);


printf("\n enter a value for b:");


scanf("%i",%26amp;b);


c=a+b;


printf("\n the value for c is: %i",c);


getch();


}


No comments:

Post a Comment