strstr valgrind error
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need some help with char* initialization and strstr in C. This is the general issue: I have a function func1 func1() func2(); The issue is that valgrind gives an error basically saying that strstr might be using an uninitialized value. To rectify this, I'd have to do something like char* str = "hello world"; , but then I can't realloc , which is an issue. I have tested my program with random strings and the issue is the fact that valgrind is treating str as uninitialized, but I just don't know how to initialize it without getting rid of