hiddenpremise
Jan 15, 2009, 01:45 PM
How do I pass an integer value through the argv[] array?
ex
#include <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSLog(@"The int value you passed was: %d", argv[1]);
return (0);
}
If I were to then run this
pMac:/ premise$ ./myApp 7
in my terminal I get back some gigantic negative number that is not 7.
ex
#include <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSLog(@"The int value you passed was: %d", argv[1]);
return (0);
}
If I were to then run this
pMac:/ premise$ ./myApp 7
in my terminal I get back some gigantic negative number that is not 7.
