xewang
2011-06-11 22:15:33 UTC
I have some questions regarding question 2.
1. How do I use the shell interface to run a program?
normally I type the following in the terminal
g++ xxx.cc
./a.out
for q2, it says that I should be able to type
include xxx.cc to ran it.
Also if I want include to output to a file, would it be
include xxx.cc outfile.txt?
2. when I use this command on a simple file
cpp -P -C -traditional -cpp jane.cc
the output looks like this
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: error: iostream: No such file or directory
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: error: iomanip: No such file or directory
plus the all the code in jane.cc
Should my include also generate something like that?
3. Also for the routine #include
do we defined it like this?
#define #include( ... ) ( ... )
4. To anyone taking CS 245, is there an assignment 3 due next week? or
it's postponed because of the midterm.
Thank you!
1. How do I use the shell interface to run a program?
normally I type the following in the terminal
g++ xxx.cc
./a.out
for q2, it says that I should be able to type
include xxx.cc to ran it.
Also if I want include to output to a file, would it be
include xxx.cc outfile.txt?
2. when I use this command on a simple file
cpp -P -C -traditional -cpp jane.cc
the output looks like this
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: warning: extra tokens at end of #include directive
jane.cc:1: error: iostream: No such file or directory
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: warning: extra tokens at end of #include directive
jane.cc:2: error: iomanip: No such file or directory
plus the all the code in jane.cc
Should my include also generate something like that?
3. Also for the routine #include
do we defined it like this?
#define #include( ... ) ( ... )
4. To anyone taking CS 245, is there an assignment 3 due next week? or
it's postponed because of the midterm.
Thank you!