| | |
Setting up C compiler
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2009
Posts: 29
Reputation:
Solved Threads: 0
0
#5 Oct 21st, 2009
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:
hmm...so signal.h is linux library,and I will not be able to work these examples on win compiler???
heres example code:
C Syntax (Toggle Plain Text)
#include <stdio.h> #include <unistd.h> #include <signal.h> char user[40]; /* Bafer koji sadrzi string koji je uneo korisnik */ /* Handler za alarm */ void catch_alarm(int sig_num) { printf("Operacija je istekla. Izlazim...\n\n"); exit(0); } int main(int argc, char* argv[]) { /* Signal handler za ALRM signal */ signal(SIGALRM, catch_alarm); /* Prompt korisniku da unese string */ printf("Username: "); fflush(stdout); /* Startuje alarm od 30 sekundi */ alarm(30); /* Ceka da korisnik unese ime */ gets(user); /* Ukoliko korisnik unese ime uklanja alarm */ alarm(0); printf("Username: '%s'\n", user); return 0; }
0
#8 Oct 21st, 2009
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..
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.
![]() |
Similar Threads
- problem with dev-c++ (C++)
- assigning a TCHAR char array to std::string (C++)
- adding library (C++)
- So,everbody's using IDEs? (C++)
- Java Compiler (Java)
- Compiling (Java)
- Is my machine 32 bit machine?? (C)
- Is this possible? Is there a better approach? (C++)
Other Threads in the C Forum
- Previous Thread: what is the story of sizeof?
- Next Thread: system calls and high level statements
| Thread Tools | Search this Thread |
Tag cloud for C
#include * append array arrays asterisks binarysearch calculate changingto char character cm command copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv feet fgets file fork forloop framework function functions givemetehcodez grade graphics gtkwinlinux hacking histogram homework inches include incrementoperators input intmain() iso kernel keyboard km lazy license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft mqqueue number oddnumber odf opendocumentformat opensource overwrite owf pdf performance pointer posix problem probleminc process program programming radix recursion recv recvblocked research reversing scanf scripting segmentationfault sequential socket spoonfeeding standard string student systemcall testing threads turboc unix user variable wab whythiscodecausesegmentationfault windowsapi







