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?

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...

Edited 7 Years Ago by gerard4143: n/a

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.

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:

#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;
}

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..

Edited 7 Years Ago by gerard4143: n/a

thank you gerrard

still playing for Liverpool ha?

:)

This reference is lost on me..."still playing for Liverpool ha?"

Edited 7 Years Ago by gerard4143: n/a

This article has been dead for over six months. Start a new discussion instead.