I have a string in C++ of type const char* passed as argument to strlen, but it returns void.
it goes like
strlen(astruct.string);
Thanks..
EDIT: Did some checking,
strlen('test');
still gives void.. why?
EDIT: Here’s the image http://img14.imageshack.us/img14/1808/strlen.png
Sorry for being unclear previously. Formatting was not working quite well. Anyway, the confusion was solved by both Evan Teran and Vlad Romascanu. Also take a look at Brian R. Bondy’s answer.
Thanks. Feel free to close.
Referring to your screen shot: your debugger is displaying
<void>forstrlen(...)when in fact it should display an error.You cannot call methods and display their results in the debugger watch. The debugger will only display existing variables and data. It cannot invoke arbitrary methods on demand since the methods can alter the state of the program being debugged in ways that were not anticipated by either the author of the code nor by the debugger.
What you can do is, in your code, temporarily add:
then compile, and add tmp_len to the watch.