I can't understand. this is a program to get an 10 characters including a-z, A-Z, and _ .
then this program will cout the text with out _ !
example:
cin >> sd_fd_e_dd
cout << sdfdedd
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# include <iostream>
#include<vector>
usingnamespace std;
char a[10],m;
int main () {
m=0;
for( int i=0;i<10;i++)
cin>>a[i];
for(int j=0;j<10;j++){
if (a[j]>95&&a[j]<123&&a[j]>31&& a[j]<59){
a.erase(a.begin() + j);
}
}
for(int k= 0; k<(10-m)); k++)
cout<< a[k];
system ("pause");
}
how can I fix line 12 ?!
+ how can I totally write this program even in another way ?!
Line 12: You can't use erase on a simple char array.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/