| | |
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
* adobe api append array arrays bash binarysearch char character cm copyanyfile copypdffile createcopyoffile createprocess() csyntax directory drawing dynamic executable execv feet fgets file floatingpointvalidation fork frequency function getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux highest homework i/o ide include infiniteloop initialization input interest intmain() iso keyboard kilometer lazy license linked linkedlist linux list lowest matrix meter microsoft mqqueue multi mysql oddnumber odf open openwebfoundation overwrite pause pdf pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition scheduling segmentationfault send single socketprogramming spoonfeeding stack standard strchr string student suggestions system test testautomation unix urboc user whythiscodecausesegmentationfault win32api windows.h







