Windows Specific Gotcha! Sometimes under Windows, argv[0] does not contain the programs path, just the
executables name, which may not include its extension (such as .exe)
and may be of different capitalization then the program itself.
Header: mostly in <io.h>
| Function | Description |
|---|---|
int _access( const char *path, int mode ); | determine file access permissions |
int remove( const char *path ); | Deletes a file |
int _chmod( const char *filename, int pmode ); | Change file permissions |
int rename( const char *oldname, const char *newname ); | |
|
| Function | Description |
|---|---|
_access, _waccess | Check file-permission setting |
_chmod, _wchmod | Change file-permission setting |
_fullpath, _wfullpath | Expand a relative path to its absolute path name |
_get_osfhandle | Return operating-system file handle associated with existing stream FILE pointer |
_makepath, _wmakepath | Merge path components into single, full path |
_mktemp, _wmktemp | Create unique filename |
_open_osfhandle | Associate C run-time file descriptor with existing operating-system file handle |
remove, _wremove | Delete file |
rename, _wrename | Rename file |
_splitpath, _wsplitpath | Parse path into components |
_stat, _stat64, _stati64, _wstat, _wstat64, _wstati64 | Get file-status information on named file |
_umask | Set default permission mask for new files created by program |
_unlink, _wunlink | Delete file |
format specifier %[flags][width][.precision][{h | l | I | I32 | I64}]type
sprintf( buf, "limit to 5 chars %-.5s", strMaybeLongerThan5| - | Left Align | ||||||||||
| + | Prefix the value with a sign [ + / - ] | ||||||||||
| 0 | fills in width with zeros (ignored if width not specified) | ||||||||||
| 'space' | puts a blank space in front of positive values | ||||||||||
| # |
|
| type | Example | Description |
|---|---|---|
| c | R | char type matching printf (or wprintf) |
| C | R | char type opposite of printf (wide for printf, char for wprintf) |
| d | -14 | int, signed |
| i | 83 | int, signed |
| o | 734 | int, unsigned, octal |
| u | 63000 | int, unsigned |
| x | f135 | int, unsigned, hex with lowercase letters |
| X | F135 | int, unsigned, hex with uppercase letters |
| e | 4.012e2 | float, Scientific notation |
| E | 4.012E2 | float, Scientific notation |
| f | 401.2 | float, Scientific notation |
| g | 401.2 | float, use shorter %e or %f |
| G | 401.2 | float, use shorter %E or %F |
| s | Hello | String of chars |
| p | Af00:0134 | Address of pointer |
| n | Nothing printed, the arg must be a pointer that gets the number of chars printed |
int sscanf( const char *zSrcString, const char *zFormatString, [arguments]);
Reading until but not including '\n', and including all white space: scanf( "%[^\n]s", buf);
format specifier %[*][max width][{h | l | I | I64}]type
return value is the number of fields successfully scanned
| Item | |||||||||||||||||||||||
| * | If included, it makes whatever this % causes to be scanned, get tossed, it is not stored into a variable | ||||||||||||||||||||||
| max width | Maximum number of chars to scan ? does this count the terminating 0? | ||||||||||||||||||||||
| h | l | I | I64 | Wierd Microsoft specific stuff | ||||||||||||||||||||||
| type |
|
NOTE: See also time, Maninpulating File Times
_stat
_stat64
_futime
_futime64
_utime
_utime64
utime [???}
| Char | Trigraph |
|---|---|
# | ??= |
[ | ??( |
{ | ??< |
\ | ??/ |
] | ??) |
} | ??> |
^ | ??' |
| | ??! |
~ | ??- |
Suppressing trigraphs:
| Desired | Use | Description |
|---|---|---|
?? | ?\? | A backslash between the first and 2nd question mark |
?? | ???/? | A trigraph escaped question mark between the first and 2nd question mark |