I\'m using C++ and XCode to create a cmd line app to save file permissions, however I can\'t get the sperm() method to be identified, the error is
\'Use
Assuming the function is defined (and I'm not going to google that name from work), you have a problem with the way you're printing it:
cout << "%10.10s", sperm(statbuf.st_mode);
That's not going to print a formatted string, since C++ iostreams don't work like C's printf
. You could either not format it:
cout << sperm(statbuf.st_mode);
or use printf
:
printf("%10.10s", sperm(statbuf.st_mode));
or do some jiggery-pokery with iostream manipulators.