11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 30: The Ten Most Important Optional Features of Dev-C++ 389Avoid Illegal FilenamesDev-C++ isn’t very good at identifying illegal filenames. Rather than generatinga meaningful message (such as maybe, “Illegal Filename”), the compilergenerates a string of misleading error messages.Dev-C++ can’t handle filenames that contain spaces. The filename MyProgram.cpp is not allowed. Nor can it handle folder names containingspaces. The filename C:\My Folder\MyProgram.cpp is not legal either.Dev-C++ can handle network files, but the Console window cannot. Thus, youcan compile the program \\Randy\MyFolder\MyProgram.cpp, but you can’tdebug resulting executable. In addition, the program executes normally atfirst but generates some obscure operating system error message before itcompletes.Include #include Files in Your ProjectC++ allows you to collect statements into separate files that you can #includein multiple source files. C++ puts no restrictions on the type of things that youcan put in an include file. However, you should put only the following types ofstatements in an include file: Function prototypes Class definitions Template definitions of all types Definition of all global variablesYou should not include executable statements (except for functions withinthe class definition itself) in an include file. Remember to add the include filenameto the project list, even though it contains no source code. Doing sotells Dev-C++ to rebuild the C++ source whenever an include file changes.Executing the ProfilerYou shouldn’t be overly concerned with how fast your program will run whenyou’re writing. (By this, I’m not suggesting that you do really stupid thingsthat take up lots of computer time.) It’s hard enough to write a working programwithout worrying about writing tricky “efficient” C++ code statements.In addition, it’s an odd fact that, if you ask a programmer where she spendsmost of her programming time, she’s almost always wrong!

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!