|
-
Nov 13th, 2000, 11:39 AM
#1
Thread Starter
Addicted Member
Header Help!!
I was wondering, I've been writing C++ in Unix lately and the problem is that the iostream.h header isn't built in(unlike borland or microsoft). Can I just define the header like it was a custom header I wrote? Like
Code:
#include "c:\headerfolder\custom.h"
thats usual but will this work? I'm running unix dual on a Windows machine so...
Code:
#include "/dos/c++/.../iostream.h"
Is that legal or is there another way to do it?
[Edited by Chris_Se on 11-13-2000 at 01:23 PM]
-
Nov 13th, 2000, 03:33 PM
#2
Monday Morning Lunatic
The reason iostream.h isn't there is because it's non-standard. Use iostream instead. You'd need to do this, though:
Code:
#include <iostream>
using namespace std; // Very important!
void main() { ... }
Make sure that you use the things from the "Standard C++ Library".
NB: There may be a few slight syntax variations, but nothing too major.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 13th, 2000, 05:18 PM
#3
Thread Starter
Addicted Member
So Parksie
So using iostream instead of iostream.h will work in a Unix compiler? Btw I'm compiling with gcc if that matters
-
Nov 14th, 2000, 06:42 AM
#4
Monday Morning Lunatic
I used g++, but I think they're basically the same. I was able to get a few programs working quite well under both compilers with the same source, so that should be fine.
PS: using namespace std; is about the biggest change
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 14th, 2000, 11:31 AM
#5
Thread Starter
Addicted Member
Whats the diff
Whats the main differences in using namespace std? I've only used it once for an array example from a book I saw
-
Nov 14th, 2000, 11:39 AM
#6
Thread Starter
Addicted Member
Hmm, I'm on a roll
While I'm on a roll here, could you direct me to a resource showing how to create objects(a GUI) using console C++? I don't like MFC because that would cause me to have to use VS.
-
Nov 14th, 2000, 02:51 PM
#7
Monday Morning Lunatic
Do you mean a console GUI like the one on programs like DOS Edit? Or an actual Windows program, but done using the API?
Either way, it will not be portable away from a PC
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 14th, 2000, 09:19 PM
#8
Thread Starter
Addicted Member
No
It will be for windows, I just dont want to use VS, i prefer Borland
-
Nov 24th, 2000, 07:14 PM
#9
Hyperactive Member
to create a windows gui without visual tools or MFC, use CreateWindowEx to create controls, etc. to change controls and get their props use SendMessage, etc, etc.
its just a lot of boring code
buzzwords are the language of fools
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|