Can someone highlight me on the functions present in stdlib.h. I think there is a function called as system in stdlibh. Could someone tell the purpose or the usage of this function also?
Printable View
Can someone highlight me on the functions present in stdlib.h. I think there is a function called as system in stdlibh. Could someone tell the purpose or the usage of this function also?
Norman I am not aware about the system function mentioned by you. Hope we get to know about this in discussion by someone. But I could tell some of the functions I am aware of present in stdlib.h . They are namely atoi, atof, atol, calloc, malloc, getenv, putenv. There are of course numerous other functions preset in stdlibh.
[b]system() is used to issue system command .
[/b] it's prototype is present in [b]stdlib.h[/b]
on success it returns 0 else it returns a -1.
System() accepts string as an argument [b][u]
it's prototype is :
[/u][/b] [b]int system(const char *command);[/b]
system() is present in stdlib.h
***********************************************
It is used to execute subprocesss and commands inside a program.
These are passed in the form of string as paramater.
int system(const char *command);
it will return -1 on faliure but behaviour may change under some conditions.
*********************************************
Your handy C reference manual should list all of the library functions for each header; if it doesn't, get a better one (I use "C: A Reference Manual" by Samuel Harbison & Guy Steele, currently 5th edition).
You can also find the list of library functions in the [url="http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf"]online draft standard[/url] (.pdf file); see section 7.20.4.6 for a description of the [font="Courier New"]system()[/font] function.