Mac Xcordでの画面のクリア
Posted: 2020年7月21日(火) 02:15
MacのXcordで開発を作業をおこなっています。
scanfで数値を入力して、その数値を画面上から消してから次の処理に進みたいです。
ネットで調べたところ、system("clear");でできるとのことなので、行なったのですが、
Implicit declaration of function 'system' is invalid in C99のwarningが表示されてしまいます。
この方法の解決策か他の手法はないでしょうか?
一応コードと実行結果を貼っておきます。
<cord>
#include <stdio.h>
int main(){
int num;
printf("自分の数字を入力\n>");
scanf("%d",&num);
system("clear");
return 0;
}
</cord>
<実行結果>
自分の数字を入力
>315
TERM environment variable not set.
Program ended with exit code: 0
scanfで数値を入力して、その数値を画面上から消してから次の処理に進みたいです。
ネットで調べたところ、system("clear");でできるとのことなので、行なったのですが、
Implicit declaration of function 'system' is invalid in C99のwarningが表示されてしまいます。
この方法の解決策か他の手法はないでしょうか?
一応コードと実行結果を貼っておきます。
<cord>
#include <stdio.h>
int main(){
int num;
printf("自分の数字を入力\n>");
scanf("%d",&num);
system("clear");
return 0;
}
</cord>
<実行結果>
自分の数字を入力
>315
TERM environment variable not set.
Program ended with exit code: 0