When ever the code execution get complete all the allocated memory will get free.So in the first example the allocated memory freed when the end...
I tried this in linux machine.We can do this . You have to mention like the following , FILE *file=fopen(PATH"/file.txt","r+"); Don't...
I think this is your home work . Try by your own . If you struck any where then post here .
strtok is the best way for this, #include <stdio.h> #include <string.h> int main () { char str[] ="15:30:12"; char *hh,*mm,*ss; hh =...
The macro is substituted like the following , #include<stdio.h> #define SQR(x) x * x int main() { printf("%d", 225/15*15); } Because of...
Your way of coding is making a easy things to difficult one.Also as shabbir said segmentation fault is not a compile time error . It is a run...
The problem happen by the '\n' of the line.Since it gets the input till the newline the entered '\n' will remain in the buffer . That '\n' will...
It is equal to gets . By default scanf will read the input until it receives a word separator ( space,tab,etc ). We can change that to some...
Try this in your own . it there is any problem then ask the doubt .
You can not convert the full string to a double .Because when you convert you need just a single value . Consider the code, #include <stdio.h>...
Using the function kill() you can end the process ,for this you need the process id .The function raise() will end the current process . man 2...
I think you print the output using the '%g".Use "%f " and try .You will get a understandable output.
You can check the null by checking the input using the strcmp function. #include<stdio.h> #include<string.h> main() { char str[100];...
Why you end up the if statement by ';'. if( a<1 && a>2 && b<1 && b>2 && c<1 && c>2 && d<1 && d>2 && e<1 && e>2 && f<1 && f>2 && g<1 && g>2 &&...
The problem is in the if and else if conditions . if ( (a<1) && (a>2) && (b<1) && etc ..) You should have the logical operators to check all...
There is big mistake in your port scanner function ,because of that only it doesn't work for the next attempt . I too missed to debug it in the...
Sorry , I forgot to explain the reason for removing the close(new) .I removed because the connect will always return 0 for success and -1 for...
Its to avoid the buffer problem.Some times the buffer may contain '\n'.Because the previous scanf will not consider the '\n' which you gave after...
Its not the problem with the goto , its problem with the buffer . I made some small changes in your program and now its working fine.Just close...
As of my knowledge , there is no way other than writing to a file, and reading it. refer the following url ,...
Separate names with a comma.