C Programming Questions...

Gamingphreek

Lifer
Mar 31, 2003
11,679
0
81
I have a project due in C, but I had a few questions regarding the IDE and environment.

1. Teacher recommended a bunch of different IDE's but Eclipse wasn't in there. Last I checked Eclipse did C/C++ ... is there any reason that it wouldn't work?

2. I am running 64bit Linux on my desktop. I need to make sure my code compiles on Virginia Tech's server cluster by remote login. Is there any reason to be concerned given that I am running a 64bit OS (Server is running Linux)

3. Last time I programmed in C/C++ 2 years ago, I used cout >> and cin <<. I also used #include <iostream.h>. I am now expected to use stdio.h and printf()/scanf();. Is there a reason why the way I am used to wouldn't work? Is there a preferred version when programming in C?

Thanks,
-Kevin
 

The J

Senior member
Aug 30, 2004
755
0
76
<iosteam>, cin, and cout were introduced in C++ (cin and cout are objects) and so cannot be used in C. I've run 64-bit Ubuntu on my machine and had no problems compiling my code on my college's 32-bit Fedora machines, so I think you'll be okay as long as you don't have code that assumes the size of datatypes (int, long, double, etc.); use the sizeof keyword if you need it. Finally, the last time I checked, the Eclipse CDT (C Development Tools) were very far from complete and so was not a good choice. This was several years ago, though, and so may be a good choice nowadays. If you want to use an IDE on Linux, there's KDevelop, Anjuta, and a few others.
 

Gamingphreek

Lifer
Mar 31, 2003
11,679
0
81
Originally posted by: The J
<iosteam>, cin, and cout were introduced in C++ (cin and cout are objects) and so cannot be used in C. I've run 64-bit Ubuntu on my machine and had no problems compiling my code on my college's 32-bit Fedora machines, so I think you'll be okay as long as you don't have code that assumes the size of datatypes (int, long, double, etc.); use the sizeof keyword if you need it. Finally, the last time I checked, the Eclipse CDT (C Development Tools) were very far from complete and so was not a good choice. This was several years ago, though, and so may be a good choice nowadays. If you want to use an IDE on Linux, there's KDevelop, Anjuta, and a few others.

Can I not just use the CLI?

Write the code in gedit and then use BASH commands to compile it using the GCC compiler in Linux??

Thanks,
-Kevin
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
1. No, Eclipse should work fine.
2. No, unless you're doing something particularly fancy.
3. cin/cout are C++ commands, not a part of C.

You could write the code in gedit (or emacs or vi or any text editor) and compile with gcc.
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
Originally posted by: Gamingphreek
Originally posted by: The J
<iosteam>, cin, and cout were introduced in C++ (cin and cout are objects) and so cannot be used in C. I've run 64-bit Ubuntu on my machine and had no problems compiling my code on my college's 32-bit Fedora machines, so I think you'll be okay as long as you don't have code that assumes the size of datatypes (int, long, double, etc.); use the sizeof keyword if you need it. Finally, the last time I checked, the Eclipse CDT (C Development Tools) were very far from complete and so was not a good choice. This was several years ago, though, and so may be a good choice nowadays. If you want to use an IDE on Linux, there's KDevelop, Anjuta, and a few others.

Can I not just use the CLI?

Write the code in gedit and then use BASH commands to compile it using the GCC compiler in Linux??

Thanks,
-Kevin

By all means, use the CLI -- I never use IDEs on Linux.

You can save yourself some keystrokes at compile-time by using Make -- your instructor will probably prefer that anyway, unless you have specific instructions otherwise.
Tutorial: http://oucsace.cs.ohiou.edu/~bhumphre/makefile.html
 

tfinch2

Lifer
Feb 3, 2004
22,114
1
0
Originally posted by: degibson
Originally posted by: Gamingphreek
Originally posted by: The J
<iosteam>, cin, and cout were introduced in C++ (cin and cout are objects) and so cannot be used in C. I've run 64-bit Ubuntu on my machine and had no problems compiling my code on my college's 32-bit Fedora machines, so I think you'll be okay as long as you don't have code that assumes the size of datatypes (int, long, double, etc.); use the sizeof keyword if you need it. Finally, the last time I checked, the Eclipse CDT (C Development Tools) were very far from complete and so was not a good choice. This was several years ago, though, and so may be a good choice nowadays. If you want to use an IDE on Linux, there's KDevelop, Anjuta, and a few others.

Can I not just use the CLI?

Write the code in gedit and then use BASH commands to compile it using the GCC compiler in Linux??

Thanks,
-Kevin

By all means, use the CLI -- I never use IDEs on Linux.

You can save yourself some keystrokes at compile-time by using Make -- your instructor will probably prefer that anyway, unless you have specific instructions otherwise.
Tutorial: http://oucsace.cs.ohiou.edu/~bhumphre/makefile.html

SCons > Make
 

The J

Senior member
Aug 30, 2004
755
0
76
Originally posted by: Gamingphreek
Can I not just use the CLI?

Write the code in gedit and then use BASH commands to compile it using the GCC compiler in Linux??

Thanks,
-Kevin

Sure can. That's what I do. I figured I'd tell out what's available since you were originally asking about using Eclipse.