   scanf was declared deprecated
  HI! i changed to VC8express from CodeBlocks but i have some problems(-:when i compiled simple console app with some prints and scanfs  i have this output:------ Build started: Project: CastleBuild, Configuration: Debug Win32 ------Compiling...main.cpp.\main.cpp(29) : warning C4996: 'scanf' was declared deprecated   C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(295) : see declaration of 'scanf'   Message: 'This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'.\main.cpp(73) : warning C4996: 'scanf' was declared deprecated   C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(295) : see declaration of 'scanf'   Message: 'This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'.\main.cpp(84) : warning C4996: 'scanf' was declared deprecated   C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(295) : see declaration of 'scanf'   Message: 'This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'d:\microsoft visual studio 8\projects\castlebuild\castlebuild\main.cpp(95) : warning C4717: 'main' : recursive on all control paths, function will cause runtime stack overflowLinking...Embedding manifest...Build log was saved at "file://d:\Microsoft Visual Studio 8\Projects\CastleBuild\CastleBuild\Debug\BuildLog.htm"CastleBuild - 0 error(s), 4 warning(s)========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========then i use this: _CRT_SECURE_NO_DEPRECATE(at begin of the code) as it says but i now have this outputCompiling...main.cpp.\main.cpp(10) : error C2144: syntax error : 'int' should be preceded by ';'.\main.cpp(10) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-intBuild log was saved at "file://d:\Microsoft Visual Studio 8\Projects\CastleBuild\CastleBuild\Debug\BuildLog.htm"CastleBuild - 2 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========im sure this is my nooooob easy error.plz help.thx.   
  Hard to know what's wrong without seen your call to scanf.   ;  Posting the code around line 10 may help.   ;  By "use _CRT_SECURE_NO_DEPRECATE" the compiler most likely means do:#define _CRT_SECURE_NO_DEPRECATEsomewhere before you #include the CStdLib headers.Don't just put "_CRT_SECURE_NO_DEPRECATE" alone at the top of your code; that will produce syntax errors (as you saw).   ;  I predict someone will tell you to use std::iostream ;)Concerning the deprecated warnings, you gan just ignore the 4996 warining (you can set this in the project's options, or use a pragma - check VS doc, I cant remember -)But importantly, warnings are here for a reason, so working arround them is maybe not the best idea, unless you have no other choice of course.   ;  Edit the Linker or C/C++ Code options (I forget which) to define _CRT_SECURE_NO_DEPRECATE.OR do it like this:char *buf;buf = (char*)malloc(sizeof(char)*1024);scanf_s("%s",buf,1024);// do stuff// laterfree((void*)buf);   ;Quote:Original post by jantaI predict someone will tell you to use std::iostream ;)Concerning the deprecated warnings, you gan just ignore the 4996 warining (you can set this in the project's options, or use a pragma - check VS doc, I cant remember -)But importantly, warnings are here for a reason, so working arround them is maybe not the best idea, unless you have no other choice of course.Yep. Show me the whole source file (I'm guessing it's not too much longer beyond the erroneous lines indicated? So 100, maybe 200 lines?) and I'll show you the actual language that you're claiming to be using (C++) ;)   ;Quote:Original post by ZahlmanQuote:Original post by jantaI predict someone will tell you to use std::iostream ;)Concerning the deprecated warnings, you gan just ignore the 4996 warining (you can set this in the project's options, or use a pragma - check VS doc, I cant remember -)But importantly, warnings are here for a reason, so working arround them is maybe not the best idea, unless you have no other choice of course.Yep. Show me the whole source file (I'm guessing it's not too much longer beyond the erroneous lines indicated? So 100, maybe 200 lines?) and I'll show you the actual language that you're claiming to be using (C++) ;)Where does he claim to be using C++?  Looks like he's using plain C as he says he's using printf/scanf.  *shrug*.  But anyways OP post some code and put it in [ source][ /source] blocks please.;Quote:Original post by Mike2343Where does he claim to be using C++?In the name of his source file. :)(Note that the compiler does, in fact, believe him: ".\main.cpp(10) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int".)   ;  The problem with scanf is that it leaves a newline character in the buffer after it is done executing.  If you're using C++ use <iostream> instead.   