I am not a C programmer, so I am not that familiar with C-string but now I have to use a C library so here is a shortened version of my code to demonstrate my problem:
char** ReadLineImpl::my_completion () {
char* matches[1];
matches[0] = "add";
return matches;
}
I am getting this warning:
Warning - address of stack memory associated with local variable 'matches' returned
And my program does not seem to work properly (might be because of the above mentioned warning).
What does the warning imply? and will it cause any problems?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…