(moorecm@dhcp43-172-16-101)~/<2>test3:131$ ls
main.cpp
(moorecm@dhcp43-172-16-101)~/<2>test3:132$ cat main.cpp
struct Bounds
{
int min;
int max;
};
const struct Bounds B1 = {3, 14};
const Bounds B2 = {3, 14};
int main()
{
return 0;
}
(moorecm@dhcp43-172-16-101)~/<2>test3:133$ gcc main.cpp
(moorecm@dhcp43-172-16-101)~/<2>test3:134$ ls
a.out* main.cpp
(moorecm@dhcp43-172-16-101)~/<2>test3:135$ gcc --version
gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(moorecm@dhcp43-172-16-101)~/<2>test3:136$
Though when you pipe a .cpp file into gcc, it compiles it using the C++ compiler, not
the C compiler. Otherwise "const Bounds B2 = { 3, 14 };" wouldn't compile since
C requires "struct".