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

Username:   Password: 
 RegisterRegister   
 MinGW - Trouble With File Input and Output
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
nike52




PostPosted: Mon Jun 30, 2008 1:16 pm   Post subject: MinGW - Trouble With File Input and Output

Hey Smile

I installed MinGW.
When I compile on cmdline with g++ text.cpp, it works, an 'a' file appears. When I used the command ./a.out < input.txt for input and output in cmdline, the cmdline says '.' is not recognized as an internal or external command, operable file, or batch file.

Can you guys tell me what's wrong ?
Sponsor
Sponsor
Sponsor
sponsor
apomb




PostPosted: Mon Jun 30, 2008 1:39 pm   Post subject: RE:MinGW - Trouble With File Input and Output

"./a.out" is a unix command, first of all. you cant run unix commands in windows unless you're using cygwin or something.

in order to compile and run files in windows, you compile and link using
code:
gcc -o hello hello.c
alternatively, you could do it in two steps:
code:
g++ -c hello.cpp
g++ -o hello hello.o
nike52




PostPosted: Mon Jun 30, 2008 2:44 pm   Post subject: Re: MinGW - Trouble With File Input and Output

Oh. So that's what I was doing wrong. Ok. Thx alot apomb ! Very Happy
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 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: