Originally Posted by
sean_mackrory
3) I'm not familiar with that function so this is just a guess. strlwr might return an entire string instead of being able to do it with single chars. Tell us what compilet you are using and exactly what error message you are given and I'm sure someone more familiar with C++ functions will be able to pin point the problem.
I'm using Dev-C++ 4.9.8.0,and this is the code:
Code:
#include <iostream>
#include <string.h>
int main()
{
char string[100];
std::cout<<"Type a string:";
std::cin.getline(string,'\n');
for (int x=0;x<100;x++)
{
string[x]=strlwr(string[x]);
}
std::cout<<"Your string now holds:\n";
std::cout<<string;
return 0;
}
This is the error I get:
12 C:\WINDOWS\***************
invalid conversion from `char' to `char*'
highlighting the line:
Code:
string[x]=strlwr(string[x]);
I know I can use the built in functions from string.h or any other include file,but I sort of want to write my own string manipulating functions from scratch,because I think that in the long run,it'll be more beneficial to get a better understanding of the whole strings stuff right now instead of using someone else's code while I have no idea how the thing is actually done