How to store path names in a string in C?
argv[1]=argv[1]/filenames[j]
argv[1]=folder1
an开发者_如何学运维d filenames[2]=cool
I want to store folder1/cool in argv[1] how to proceed? I am not familiar with C.
- you should be using
"folder1"
and"cool"
if these are litterals - you should use
strcat(str1, str2)
if you want to mimmicstr1 = str1 + str2
of e.g. Java - you might prefer
sprintf(str1, "%s/%s","folder","cool")
- none of the above is correct unless
str1
is an array of char that has enough room to store the result (welcome to C)
精彩评论