Open zxytim opened 11 years ago
class A [static] a: int[1000] void func() a[1] = 2 int main() dummy: int = 5
compiled to .h file
#pragma once class A { static int a[1000]; void func(); }; int main();
and corresponding cpp file
#include "x.h" void A::func() { a[1] = 2; } int main() { int dummy = 5; }
but in fact there should have int A::a[1000] in cpp file.
int A::a[1000]
But as I tried like:
class A [static] a: int[1000] void func() a[1] = 2 A::a: int[1000] int main() dummy: int = 5
it compiled into .h
#pragma once class A { static int a[1000]; void func(); }; extern int A::a[1000]; int main();
and .cpp
#include "x.h" void A::func() { a[1] = 2; } int A::a[1000]; int main() { int dummy = 5; }
where the extern in .h file is not what I want
extern
Oh! Thank you very much to point out this issue!
I think this issue has been fixed now.
compiled to .h file
and corresponding cpp file
but in fact there should have
int A::a[1000]
in cpp file.But as I tried like:
it compiled into .h
and .cpp
where the
extern
in .h file is not what I want