#include <stdlib.h>
#include <stdio.h>
int main(void)
{
char path_buffer[_MAX_PATH];
char drive[_MAX_DRIVE];
char dir[_MAX_DIR];
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
_makepath(path_buffer, "c", "\sample\myprogarm\","makepath", "txt" ); // C4996
printf( "Path created with _makepath: %s ", path_buffer );
_splitpath( path_buffer, drive, dir, fname, ext ); // C4996
printf("Path extracted with _splitpath: ");
printf("Drive: %s ", drive );
printf("Dir: %s ", dir );
printf("Filename: %s ", fname );
printf("Ext: %s ", ext );
return 1;
}
#include <stdio.h>
#include <string.h>
int main(int argc, char * argv[])
{
char s[10] = {0};
int strLen = strlen(_pgmptr);
if (sizeof(s)/sizeof(s[0]) < strLen)
{
strLen = sizeof(s)/sizeof(s[0]);
}
memcpy(s, _pgmptr, strLen);
s[sizeof(s)/sizeof(s[0])] = ' ';
printf("
s=%s
", s);
system("pause");
return 0;
}