944,083 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 634
  • C RSS
Oct 20th, 2009
0

Setting up C compiler

Expand Post »
hi to everybody on this most helpful programing board

I have trouble setting up Dev C++ compiler,I have a lot of errors in 100% right code so I guess that compiler isnt set right.

I want to work in C.

here's example:

Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
suncica2222 is offline Offline
105 posts
since Jun 2009
Oct 20th, 2009
0
Re: Setting up C compiler
Quote ...
I have a lot of errors in 100% right code so I guess that compiler isnt set right.
Before throwing insults to the compiler, could you maybe first post your 100% right code?
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
Oct 20th, 2009
0
Re: Setting up C compiler
I noticed by your imagine that your including Linux header files...So you have this installed on Linux machine?

I also noticed that your file is located in C:\ which is Windows...
Last edited by gerard4143; Oct 20th, 2009 at 7:06 pm.
Reputation Points: 499
Solved Threads: 367
Postaholic
gerard4143 is offline Offline
2,197 posts
since Jan 2008
Oct 21st, 2009
0
Re: Setting up C compiler
Quote ...
So you have this installed on Linux machine?
Dev-C++ is Windows software, so I think it is safe to assume that he's using Windows.
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
Oct 21st, 2009
0
Re: Setting up C compiler
Im using win xpsp2

hmm...so signal.h is linux library,and I will not be able to work these examples on win compiler???

heres example code:

  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <signal.h>
  4. char user[40]; /* Bafer koji sadrzi string koji je uneo korisnik */
  5. /* Handler za alarm */
  6. void catch_alarm(int sig_num)
  7. {
  8. printf("Operacija je istekla. Izlazim...\n\n");
  9. exit(0);
  10. }
  11. int main(int argc, char* argv[])
  12. {
  13. /* Signal handler za ALRM signal */
  14. signal(SIGALRM, catch_alarm);
  15. /* Prompt korisniku da unese string */
  16. printf("Username: ");
  17. fflush(stdout);
  18. /* Startuje alarm od 30 sekundi */
  19. alarm(30);
  20. /* Ceka da korisnik unese ime */
  21. gets(user);
  22. /* Ukoliko korisnik unese ime uklanja alarm */
  23. alarm(0);
  24. printf("Username: '%s'\n", user);
  25. return 0;
  26. }
Reputation Points: 10
Solved Threads: 0
Junior Poster
suncica2222 is offline Offline
105 posts
since Jun 2009
Oct 21st, 2009
0
Re: Setting up C compiler
No the library I was referring to was unistd.h which means unix std library....
Reputation Points: 499
Solved Threads: 367
Postaholic
gerard4143 is offline Offline
2,197 posts
since Jan 2008
Oct 21st, 2009
0
Re: Setting up C compiler
is there a way to compile this in windows?
Reputation Points: 10
Solved Threads: 0
Junior Poster
suncica2222 is offline Offline
105 posts
since Jun 2009
Oct 21st, 2009
0
Re: Setting up C compiler
is there a way to compile this in windows?
The short and probably the only answers is no, you'll have to port it...If your using a Windows compiler why don't you check out the internet its packed with example code or try Googling this "the c programming language pdf"

Its a great intro to C and all the Unix/Linux parts are crammed into the last chapter so you don't have to worry about porting code..
Last edited by gerard4143; Oct 21st, 2009 at 7:23 pm.
Reputation Points: 499
Solved Threads: 367
Postaholic
gerard4143 is offline Offline
2,197 posts
since Jan 2008
Oct 22nd, 2009
0
Re: Setting up C compiler
thank you gerrard

still playing for Liverpool ha?

Reputation Points: 10
Solved Threads: 0
Junior Poster
suncica2222 is offline Offline
105 posts
since Jun 2009
Oct 22nd, 2009
0
Re: Setting up C compiler
thank you gerrard

still playing for Liverpool ha?

This reference is lost on me..."still playing for Liverpool ha?"
Last edited by gerard4143; Oct 22nd, 2009 at 2:30 pm.
Reputation Points: 499
Solved Threads: 367
Postaholic
gerard4143 is offline Offline
2,197 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: what is the story of sizeof?
Next Thread in C Forum Timeline: system calls and high level statements





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC