0xEFCDAB89;
msgDigest[2] = 0x98BADCFE;
msgDigest[3] = 0x10325476;
msgDigest[4] = 0xC3D2E1F0;
void main () {
printf("%lx",msgDigest[0])
}But this does:
void main () {
long msgDigest[5];
// Initial msgDigest Values
msgDigest[0] = 0x67452301;
msgDigest[1] = 0xEFCDAB89;
msgDigest[2] = 0x98BADCFE;
msgDigest[3] = 0x10325476;
msgDigest[4] = 0xC3D2E1F0;
printf("%lx",msgDigest[0])
} Is there some fact about C i am missing? Do i need something else to make a global variable?
sha1.c:7:1: warning: data definition has no type or storage class msgDigest[0] = 0x67452301; ^ sha1.c:7:1: warning: type defaults to ‘int’ in declaration of ‘msgDigest’ [-Wimplicit-int] sha1.c:7:1: error: conflicting types for ‘msgDigest’ sha1.c:5:6: note: previous declaration of ‘msgDigest’ was here long msgDigest[5]; ^
"Assignment is not allowed at global scope." Kanged from stackoverflow
Обсуждают сегодня