Because strlen
expects to get a char const*
as it's argument. You should probably use s.size()
instead as s
is a std::string
.
In addition you should probably not compute strlen
inside a loop like that due to performance issues (s.size
on the other hand should be able to complete in O(1) time so it would be OK).
Then there's a few other problems with your program, already at line one. You can't include a file by using #include //iostream
, you should use #include <iostream>
instead.
Second you cannot declare a variable in the condition of a for loop as you try to do, and you probably shouldn't assign instead of comparing (one equal sign is not the same as two). You should have written for( int i = 0; i != s.size(); i++ )
Third you shouldn't do the check in the update expression in the for
construct. What goes there will only be evaluate to update the loop variables and such and the truth value will be disregarded.
Overall I think you should pick up an introduction to C++ book or find a good tutorial online. Your code simply has to much problems to conclude that you have learnt even the most basic C++.