本文介绍了我必须free()const char *吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是想知道我是否必须对const char *指针或字符串(idk是哪个)调用free().我之所以奇怪,是因为*,这似乎意味着它是一个指针.这是我的方法:
Hi, I''m just wondering if I have to call free() on a const char * pointer or string (idk which one it is). The reason why I''m wondering this is because of the *, which would seem to imply that it''s a pointer. This is how I do it:
const char * filenames[2] = {"file1.png", "file2.png"};
预先感谢您的所有答复! -B
Thanks in advance for any and all replies! -B
推荐答案
这篇关于我必须free()const char *吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!