VC++ and unix c++ ...

hergehen

Senior member
Sep 13, 2001
640
0
0
Hello,


I'm trying to do some program for windows, but I'm not used to program in VC++ :( ... so I wrote classes in unix (gcc) ... are they compatible ... ? .. and how do I find what header files(classes) does vc++ has ? ...

for now I need: string, iostream, fstream ... maybe more later ...

thx.
 

JW310

Golden Member
Oct 30, 1999
1,582
0
0
here are the include lines you'd need in VC++

#include <iostream>
#include <string>
#include <fstream>

So yes, I would guess that they're somewhat compatible... not familiar with gcc, though, so I couldn't say for sure.

JW
 

hergehen

Senior member
Sep 13, 2001
640
0
0
yeah, the same in gcc ....

but when I did simple program in vc++

#include <iostream>

int main()
{

cout << "test";

};


it just gave me some weird error :( ... forgot what it was though, will try later again :)
 

jpsj82

Senior member
Oct 30, 2000
958
0
0
what was the error?

do you need to have
return 0;
as the last line in your main()?
 

dimagog

Junior Member
Feb 18, 2002
9
0
0
you should use
<iostream.h>

if you use it without the ".h", then do this:

<iostream>
using namespace std; // stands for standard library, not sexual deseases :)

void main()
{
...
 

Elledan

Banned
Jul 24, 2000
8,880
0
0


<< Hello,


I'm trying to do some program for windows, but I'm not used to program in VC++ :( ... so I wrote classes in unix (gcc) ... are they compatible ... ? .. and how do I find what header files(classes) does vc++ has ? ...

for now I need: string, iostream, fstream ... maybe more later ...

thx.
>>


- as long as you stick to ANSI C++ (or stay close to it), you should have very little problems with the more ANSI-compliant compilers. VC++ is one of the least ANSI-compliant compilers in existance. gcc is much better already.

- if you only use header files which are part of the standard library, every compiler will have the required header files to compile your code.
 

Arminas

Junior Member
Apr 25, 2001
9
0
0
Well if you just cut and paste your code into a text file and send it to yourself...and then paste it into the compiler your using...
as long as your code is sound, I don't see why there would be any problems.