×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 相约北美 / 移民留学 / 请教4个问题
    1) how can one compile a C++ program in UNIX?

    2) if one needed to modify a C++ program to enhance user interface, what
    would you suggest? ( write codes in C then convert to C++? ;
    learn C++? Or learn shell programming? Or )

    3) can you mix C & C++ together?

    4) *.sh what kind of file is this? How could we run it in Unix?
    • The first one is cc *.c, I guess.
    • 1. cc or gcc, g++. 2. Do not know. 3. Yes. But some recently compilers do not support it. Try and see. 4. Shell?
    • FYI
      1. Use gcc, it's free.
      2. What is the UI, GUI? or just command UI? Anyway, I prefer to learn C++, it's not difficult. For GUI, on UNIX, I think you should have to learn Motif or X Window programming, on Windows, MFC is the best one. And shell programming can't provide GUI function.
      3. You can mix, but for C code, do not forget use extern "C"
      4. Maybe it's a B shell script, actually, you needn't put .sh for shell script file, but sometime it makes clear.
    • The answers (with much details) to questions 1 to 3 can be found from any C/C++, UNIX FAQs, try http://www.dejanews.com/ The answer to 4 is not sure, not until you
      open that file and take a look at it's first line. Before you do that, make sure it's not binary (to mess up your terminal), do a "file *.sh". It's usually a Borne, Borne Again or Korn shell script as other misters have mentioned.