realy fresh to C

Reply

Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

Re: realy fresh to C

 
0
  #11
Sep 15th, 2006
#include <stdio.h>
int main(void)
{
printf("Hello world!\n");
return 0;
}

can you eplain me all...please

vhen running your file it happens nothing
an@jan-desktop:~$ gcc rep.c
jan@jan-desktop:~$ gcc rep.c
jan@jan-desktop:~$ gcc rep.c
jan@jan-desktop:~$
Last edited by jan1024188; Sep 15th, 2006 at 5:36 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,397
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: realy fresh to C

 
0
  #12
Sep 15th, 2006
gcc only compiles your program into an executable file, it does not run your program. The default name of your program is a.out because you did not tell gcc what to name it. So to run your program, try this:
  1. ./a.out <Enter key>
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

Re: realy fresh to C

 
0
  #13
Sep 15th, 2006
jan@jan-desktop:~$ ./a.out <Enter key>
bash: syntax error near unexpected token `newline'
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,397
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: realy fresh to C

 
0
  #14
Sep 15th, 2006
Use ls command to search the directory and see if it contains a file called a.out. If not, then gcc probably did not compile it. If it didn't then compare your program with what ~S.O.S.~ posted and make sure it is identical. And from here I think you need to start reading some of the links that were posted in the sticky at the top of this board. I know its a lot of reading, but if you want to learn how to program you must also be willing to do a lot of reading and studying.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

Re: realy fresh to C

 
0
  #15
Sep 15th, 2006
yes file is there but i cant open it....im gonna buy this book anyway
http://www.amazon.com/Absolute-Begin...e=UTF8&s=books
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,397
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: realy fresh to C

 
0
  #16
Sep 15th, 2006
Its good that you are going to buy a book, that's the best way to learn. But that book won't teach you a thing about gcc compiler or how to use linux. you need to learn how to compile and execute a program before that book (or most any other book for that matter) will be much help to you.
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

Re: realy fresh to C

 
0
  #17
Sep 15th, 2006
oh actualy i have another book with chapter programming tools which is including all that .....

so what with that file...im not able to open it
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,397
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1466
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: realy fresh to C

 
0
  #18
Sep 15th, 2006
Originally Posted by jan1024188 View Post
jan@jan-desktop:~$ ./a.out <Enter key>
bash: syntax error near unexpected token `newline'
I did not mean for you to type "<Enter key>" on the command line -- that only meant that you should have hit the Enter key on the keyboard. If you actually typed that text, then try it again without that part. just
  1. $ ./a.out
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 254
Reputation: jan1024188 is an unknown quantity at this point 
Solved Threads: 2
jan1024188's Avatar
jan1024188 jan1024188 is offline Offline
Posting Whiz in Training

Re: realy fresh to C

 
1
  #19
Sep 15th, 2006
thanks but i discovered that by myself....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC