I know this is basic stuff, but I'm having one particular problem with this.
I'm implementing a simple shell program, and the exit function needs to pass on the exit value if one is passed on. Therefore, exit 45 should return 45 as a value, but nothing to be printed*.
The commands are passed to a function parser in a char **arglist array. Since exit 45 is two args, I need to print out the last arg.
However,my debug statement printf((int)&arglist[1]) returns a value of 163393752, which is just slightly off from the passed in value. When I changed printf to puts, the correct value was printed out, but exit() requires an integer, not a pointer.
Using this example how can I get 45 from the pointer array?
*according to the professor, quoting his phrasing verbatim.
int.