开发者

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.


  1. you should be using "folder1" and "cool" if these are litterals
  2. you should use strcat(str1, str2) if you want to mimmic str1 = str1 + str2 of e.g. Java
  3. you might prefer sprintf(str1, "%s/%s","folder","cool")
  4. none of the above is correct unless str1 is an array of char that has enough room to store the result (welcome to C)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜