Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Newbie: About C/Java programming

  1. #1
    Join Date
    Aug 2009
    Location
    Mexico City
    Posts
    22

    Default Newbie: About C/Java programming

    Hi everyone. Altought the title says i'm newbie that's not absolutely correct, simce i'm familiar with openSuSE. The Newbie comes here:

    I have installed GCC 4.2.2. How can i run and make ejecutables from C source codes using good old printf, scanf and so on? There is any limitation between windows execs and linux ones? Apart from the FS paths etc, that is.

    I'll develop in java too. Can you give me directions on a ready environment to compile and run java source codes? This is for university, so if you can be prompt in answering you will be given sweet thanks.

    Thank you in advance!

  2. #2

    Default Re: Newbie: About C/Java programming

    Hey..I suppose you are good enough with C/C++. Put your code in filename.c and save it at some location. Now go there and do "gcc filename.c"(from terminal ofcourse). This creates an executable named "a.out". Run this by "./a.out".
    Regarding java, install latest sun's jdk and then I recommend you to install netbeans(IDE). Just google your query put "linux" at the end .

  3. #3
    Join Date
    Aug 2009
    Location
    Mexico City
    Posts
    22

    Default Re: Newbie: About C/Java programming

    Hi, thank you for your response!

    I cannot use clrscr. Can you provide me with any solution? I included stdio, but can't include CONIO because gcc can't find it.

    Where can i find the header files? Also, can you provide me with a little but useful appendix on which functions do they include? (This is C knowledge and not SuSE? perhaps.)

    Sorry for all those simple questions, but i have to print and show those codes running on monday...

  4. #4
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default Re: Newbie: About C/Java programming

    Quote Originally Posted by ibelcomputing View Post
    Hi, thank you for your response!

    I cannot use clrscr. Can you provide me with any solution? I included stdio, but can't include CONIO because gcc can't find it.

    Where can i find the header files? Also, can you provide me with a little but useful appendix on which functions do they include? (This is C knowledge and not SuSE? perhaps.)

    Sorry for all those simple questions, but i have to print and show those codes running on monday...
    Hi

    Header files are in /usr/include directory. You can look directly at the code to see what they define. The C library function are described in the man pages. man is your friend!

    There is no clrscr. You have to send ANSI escape sequences to the terminal (see man console_codes). To clear the screen you would send "ESC [ 2 J" (4 characters).

    Hope this gets you started.

  5. #5
    Join Date
    Aug 2009
    Location
    Mexico City
    Posts
    22

    Default Re: Newbie: About C/Java programming

    Man of what? GCC?

    I've also fund the header files. Thanks a lot!

    And hhow can i pass the ANSI codes from a C code?

    I've got this rolling! Thank you very much!

  6. #6

    Default Re: Newbie: About C/Java programming

    [ man for ASCI codes ]

    > [...] (see man console_codes) [...]

    That was meant literally :-) the man page for console codes, to be seen by invoking "man console_codes" :-D

    [ header files ]

    conio.h is not part of standard C but an old DOS relict... see conio.h - Wikipedia, the free encyclopedia

    [ANSI codes]

    You pass these by simply writing them to the terminal - which will be "stdout". I strongly recommend to add an abstraction layer for layouted screen handling (and "clearing the screen" already uses the concept of a screen layout!) as there are many ways to skin that cat and you'll probably want to switch to more elaborate mechanisms later on (ie ncurses or even graphical UIs).

    Regards

    Jens

  7. #7
    Join Date
    Aug 2009
    Location
    Mexico City
    Posts
    22

    Default Re: Newbie: About C/Java programming

    Wow, that of conio.h is new.

    I've recently migrated to 100% C programing under suse, so i've said goodbye to borland C, which i used before this one, that's why i'm having trouble using pause functions (a simple while to 10,000,000 will do) or these headers.

    And yes, i'll be using "elaborate" UI, but still console based (menu with borders, etc). I needed to use clrscr for that reason.

    Thanks again!

  8. #8
    Join Date
    Oct 2008
    Location
    Birmingham. AL
    Posts
    858

    Default Re: Newbie: About C/Java programming

    Single list of HOWTOs

    That's a good place to start. They have a bunch of "how tos" on the specifics of programming under Linux.

    If you install KDevelop using Yast, it will automatically set up most of what you need for development. Only one warning (speaking from experience): if you install it under Opensuse 11.1, it will automatically install and upgrade KDE to 4.1. That's not necessarily a problem if that's what you're already using, but if not, it can be extremely annoying.

  9. #9
    Join Date
    Jul 2008
    Location
    United Kingdom
    Posts
    1,149

    Default Re: Newbie: About C/Java programming

    Qt Creator looks very promising for C++.

    Hell, it looks so good I wish I knew C++.. for java you can use eclipse or netbeans.
    Word of warning with netbeans.. it's disgustingly slow with openJDK (at least for me) menus taking like 4 seconds to show up.

    Replace it with Suns version and it's a lot more responsive.

  10. #10

    Default Re: Newbie: About C/Java programming

    Both eclipse and Netbeans can be used for C/C++ as well. The latest Netbeans even has Qt support.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •