| | |
Setting up C compiler
![]() |
•
•
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 |
* ansi api array arrays bash binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile creafecopyofanytypeoffileinc createcopyoffile createprocess() directory dynamic execv fflush file floatingpointvalidation fork forloop frequency function getlasterror getlogicaldrivestrin givemetehcodez grade graphics gtkgcurlcompiling gtkwinlinux hardware highest histogram homework i/o ide inches infiniteloop initialization intmain() iso keyboard km license linked linkedlist linux list looping loopinsideloop. lowest matrix microsoft mysql oddnumber open opendocumentformat openwebfoundation pdf pointer pointers posix power program programming pyramidusingturboccodes radix read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprogramming stack standard strchr string suggestions test threads unix urboc user variable whythiscodecausesegmentationfault win32api windows.h windowsapi







