![]() |
Computer programmers, help me
40 C:\Documents and Settings\william\Desktop\ECE370\ass5\main.cpp no matching function for call to `strlen(std::string&)'
wtf is this? I have #include <string.h> |
show the previous lines ? the one using strlen() ?
|
"no matching function"
answers your question, no? |
your calling a function that you have declared
|
I have this
struct stats{ string name; int cost; }; stats blah[2]; how can i find the length of blah[0].name ? |
where are you declaring blah?
|
that is irrelevant. consider it in main.
|
whats on line 40?
|
just part of a conditional statement. I just need to know the function to get the length of a string.
|
its probably string.length or string.len (ie: length(string))
|
I think it's just being used incorrectly. Maybe this will help.
http://www.programmingforums.org/for...ad.php?p=43453 |
Thanks i found it. I saw it written online as length() and thought i used it like length(blah[0].name)
when it is actually supposed to be blah[0].name.length() thanks for looking. |
All times are GMT -7. The time now is 05:07 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123