Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-Nov-2007, 06:31
Sinne
Guest
 
Posts: n/a
Default

The GCC compiler works fine. In the last program, it showed "warning: no newline at end of file", but the program should work with this warning, right?

Anyway, when I type 'a.out', it doesn't execute, but it says "bash: a.out: command not found". :blink:

I need solution for this. Thank you very much.
  #2 (permalink)  
Old 10-Nov-2007, 06:45
ken_yap
Guest
 
Posts: n/a
Default

Use

./a.out
  #3 (permalink)  
Old 10-Nov-2007, 06:46
Sinne
Guest
 
Posts: n/a
Default

Thanks.
  #4 (permalink)  
Old 18-Nov-2007, 10:38
Phoenix76
Guest
 
Posts: n/a
Default

It's a good practice to put a newline character \n at the end of a file. Also, I think you are just entering "gcc programname.c" into the terminal, where programname.c is the name of your program. Try this though...say the name of your program is chess.c, and it's a chess game. Type "gcc -o chess chess.c" into the console instead, and then instead of the executable file being called the generic "a.out," it will be "chess," which is a much more descriptive filename. Then you would run the program by entering "./chess" into the terminal.
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2