I pick up c today for a short exercise.
Tons of error, be ashamed.
Error 1 error C2146: syntax error : missing ';' before identifier 'removechar'Code:// removechar.cpp : main project file. #include "stdafx.h" #include <string> #include <iostream> using namespace std; String removechar(String s, char c) { String r = ""; for (int i = 0; i < strlen(s); i ++) { if (s.at(i) != c) r += s.at(i); } return r; } int main() { String s; removechar re = new removechar(); s=re.removechar("abcdefg","f"); }
...
thanks for help