const in global

im doing my friend's project. and they should run it to dev c++

dev c++ complaint about initializing the variable in class.

is it alright to put the constant variables in global?

how bad is it?
Last edited on
AFAIK, the "dev c++" is a name for two or more IDE, which use different compilers for the actual work. You don't state which compiler you actually use, nor show the code that causes a problem. Hence we cannot advice on that yet.

If we could solve the actual problem, then we would not have to even consider any workarounds, whether they are virtuous or questionable.
@keskiverto im using dev c++ bloodshed


1
2
3
4
5
6
class foo {

private:
const double foobar = 10; // error in bloodshed

}


1
2
3
4
5
const double foobar = 10; 
class foo {


}

2nd snippet runs but my question is
is it alright to put the constant variables in global?

the "dev c++" is a name for two or more IDE

sorry i didnt realize it
Last edited on
You mean the one that has not been updated since 2005? I know no valid excuse to use that.
use Orwell Dev C++, that comes with latest gcc compiler.
@keskiverto i dont know but they say that this bloodshed is very outdated.
@anup30 thanks. but i already finish my friends project im back now to vs
Topic archived. No new replies allowed.