半日レスつかなかったらシンゲティスト

9d796fca :Anonymous 2019-06-11 22:45
>>a4b40ba6
大正解

>>77b89cd4
コンパイルは通るし(warningあり)、実行もできる

https://rextester.com/MVGM77674

Warning(s):

source_file.c: In function ‘main’:
source_file.c:6:8: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
char c=NULL;
^
source_file.c:7:2: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
c="hogehoge";
^
source_file.c:6:6: warning: variable ‘c’ set but not used [-Wunused-but-set-variable]
char c=NULL;
^


>>33f5f70a
コンパイルは通るが(warningあり)、SIGSEGV

https://rextester.com/BOP81028

Warning(s):

source_file.c: In function ‘main’:
source_file.c:6:8: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
char c=NULL;
^
source_file.c:8:8: warning: passing argument 1 of ‘strcpy’ makes pointer from integer without a cast [-Wint-conversion]
strcpy(c,"hogehoge");
^
In file included from /usr/include/features.h:367:0,
from /usr/include/string.h:25,
from source_file.c:1:
/usr/include/x86_64-linux-gnu/bits/string3.h:108:1: note: expected ‘char * restrict’ but argument is of type ‘char’
__NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
^

Error(s):

Invalid memory reference (SIGSEGV)


数年C言語が遠ざかっただけで
まるで駄目だな (´・ω・`)
Powered by shinGETsu.