When i type FILE as a datatype to make progs working on some files dev-cpp doesn't change it into bold as does with int float double........etc and when i run the prog it doesn't work ofcourse.
Printable View
When i type FILE as a datatype to make progs working on some files dev-cpp doesn't change it into bold as does with int float double........etc and when i run the prog it doesn't work ofcourse.
Are you doing a C++ program? If so, you have to #include <stdio.h>
Syntax highlighting only works for stuff like keywords, #define, strings and such. FILE is a typedef (not a keyword). But that does not explain why the code won't compile (or run). Have you included stdio.h? What error messages do you get?
this programe was compiled on DEV C++ complier it works fine for me, as TactX said only reserve words are highlighted
NOTE: some compilers does something like what u want but not all like DEV C++Code:#include <stdio.h>
int main()
{
FILE *fp;
fp = fopen("snake.txt","r+");
if(fp)
{
printf("The file opened with no error!!!");
getchar();
}
else
{
printf("Error: File cannot be opened");
getchar();
return 1;
}
return 0;
}
/*myoutput
The file opened with no error!!!
*/
ssharish2005