Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #include, loading, and c++




On Mar 31, 2006, at 9:38 AM, email@hidden wrote:

************ main ***********
#include <cstdlib>
#include <fstream>
#include <iostream>
using namespace std;
#include "randomChar.cpp"

As a general rule of thumb, I prefer only to include header files using the #include directive. If your intent was to have everything in the same translation unit, using the include directive to include extra implementation code only masks that intent in my opinion.


As Justin mentioned, I compiled your second example without any trouble. What is the error message Xcode gives you?

Sam Miller
Graduate Research Assistant
Department of Electrical and Computer Engineering
Iowa State University
312 Wilhelm Hall
Ames Laboratory US D.O.E. (515) 294-2148
Ames, IA - 50011 email@hidden
http://www.scl.ameslab.gov/~samm/

"If you lie to the compiler it will get its revenge." - Henry Spencer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >#include, loading, and c++ (From: <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.