Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Random compiling problem?
Index -> Programming, C++ -> C++ Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TerranceN




PostPosted: Tue Dec 11, 2012 12:19 am   Post subject: RE:Random compiling problem?

To avoid this kind of error, you should check that the file is available (using fin.is_open() or fin.fail()) before you try to access it.
Sponsor
Sponsor
Sponsor
sponsor
Panphobia




PostPosted: Tue Dec 11, 2012 12:27 am   Post subject: RE:Random compiling problem?

Well I didn't think of it maybe?
QuantumPhysics




PostPosted: Tue Dec 25, 2012 5:23 am   Post subject: RE:Random compiling problem?

Just a little tip (especially on Ubuntu). You have way too man includes there. Try to limit them (if you are working in C++). It can kill the speed performance of your program. C++ already tends to be slow on its own. If you are using .c then that's a different story -> But you should be using .c on GNU/LINUX, ever heard of emacs? sudo apt-get emacs-1.7.0.1 its great
Insectoid




PostPosted: Tue Dec 25, 2012 6:37 am   Post subject: RE:Random compiling problem?

Quote:
C++ already tends to be slow on its own.


Wait, what?

Quote:
If you are using .c then that's a different story


.c is for C source files. .cpp is for C++ source files. GCC won't even compile a c++ source file with a .c extension on my computer (though it will compile C files with a .cpp extension).

Quote:
ever heard of emacs? sudo apt-get emacs-1.7.0.1 its great


emacs is just a text editor. Not really important, and does not solve OP's issue.
QuantumPhysics




PostPosted: Tue Dec 25, 2012 6:08 pm   Post subject: RE:Random compiling problem?

I'm just saying that Cpp is slow over C. C Preprocessor is much faster. I don't understand why you cant compile a .c project as .cpp (my computer compiles it flawlessly(all my computers do))
Insectoid




PostPosted: Wed Dec 26, 2012 11:11 am   Post subject: RE:Random compiling problem?

The preprocessor has nothing to do with runtime execution. That's only compile time. And both C and C++ use the same one (if you're using gcc, anyway).

Also, I can compile C source saved as a .cpp file. I cannot compile C++ source saved as a .c file. GCC cares about your extension.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 21 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: