Hello. I got a problem of that type:
for example i have a simple program like this:
int main(){
sleep(10);
}
now if i define time to be 10 sec, prog works fine.
#define TIME 10
sleep(TIME)
but i am trying to do something like that:
char time; // or int time;
time = "10";
sleep(time);
and it's not working. Prog sleeps untill i finish it myself manualy.
The same thing i am trying to do in simple socket app to connect the net.
This line:
dest_addr.sin_port = htons(DEST_PORT);
when DEST_PORT is defined, it's ok. But i'm trying to rebuild this like with that app with sleep. The errors i've got are:
passing argument 1 of 'htons' makes integer from pointer without a cast
or
assignment makes integer from pointer without a cast.
Please help me how to do it...