私はCを初めて使用します。インターネットで文字列と配列に関するこのチュートリアルを見つけ、プログラムを実行しようとしました。彼らはEclipseを使用しており、私はVisual Studio 2010を使用しています...助けて説明してください。私はこれらの問題を抱えています:
error C2143: syntax error : missing ';' before 'type'
error C2143: syntax error : missing ';' before 'type'
error C2143: syntax error : missing ')' before 'type'
error C2143: syntax error : missing ';' before 'type'
error C2065: 'cp' : undeclared identifier
error C2100: illegal indirection
warning C4552: '!=' : operator has no effect; expected operator with side-effect
error C2059: syntax error : ')'
error C2065: 'cp' : undeclared identifier
error C2143: syntax error : missing ';' before '{'
error C2065: 'cp' : undeclared identifier
error C2100: illegal indirection
これはコードです:
#include <stdio.h>
#include <conio.h>
int main(char argc, char**argv){
char s[] = "string";
printf("string is: %s\n", s);
for(char *cp = s; *cp !=0; ++cp) {
printf("char is %c\n", *cp);
}
getch();
}