How to change the actual argument passed to a function in C?

前端 未结 4 1804
没有蜡笔的小新
没有蜡笔的小新 2020-12-22 13:15

I want to change the actual argument passed to a function and not a copy of it. For example:

char str[] = \"This is a string\";

I want to c

4条回答
  •  囚心锁ツ
    2020-12-22 13:39

    You may pass char*. The pointer will be copied, but it will still point to the same string

    If you need the pointer itself to be passed (not its copy) you should pass a char**

提交回复
热议问题