ポインターを使用して文字列を入力して、スペースを「-」(ダッシュ記号) に置き換える必要があります。
入力は次のようになります。
空は青い
出力 :
空は青い
コーディングをコンパイルして仕事を始めるのに問題があります。
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char result;
int main()
{
char string[100], *space;
{
printf("Enter a string here: \n"); //Enter a string in command prompt
gets(string); //scans it and places it into a string
space = string;
printf("%s\n", space);
result = space.Replace(" ", "-");
}
getchar();
}