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:

[IMG]http://img27.imageshack.us/img27/4492/111111af.th.jpg[/IMG]

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

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

No the library I was referring to was unistd.h which means unix std library....

is there a way to compile this in windows?

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

thank you gerrard

still playing for Liverpool ha?

:)

thank you gerrard

still playing for Liverpool ha?

:)

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.