Connecting Tech Pros Worldwide Forums | Help | Site Map

static var and static map

Gary Wessle
Guest
 
Posts: n/a
#1: Feb 19 '07
Hi

I have a method with some static double variables, if I make a
map<string,doubleinstead, will it do the same thing? apart from
assigning and accessing the values.

thank you

Gary Wessle
Guest
 
Posts: n/a
#2: Feb 19 '07

re: static var and static map


Gary Wessle <phddas@yahoo.comwrites:
Quote:
Quote:
>Hi
>
I have a method with some static double variables, if I make a
map<string,doubleinstead, will it do the same thing? apart from
assigning and accessing the values.
>
thank you
do I need to make the values themselves static or no need.
i.e
static map<string,intm;
static int a = 5;
m["a"] = 5;

or just
int a = 5;
will do?
John Harrison
Guest
 
Posts: n/a
#3: Feb 19 '07

re: static var and static map


Gary Wessle wrote:
Quote:
Gary Wessle <phddas@yahoo.comwrites:
>
>
Quote:
Quote:
>>>Hi
>>
>>I have a method with some static double variables, if I make a
>>map<string,doubleinstead, will it do the same thing? apart from
>>assigning and accessing the values.
>>
>>thank you
>
>
do I need to make the values themselves static or no need.
i.e
static map<string,intm;
static int a = 5;
m["a"] = 5;
>
or just
int a = 5;
will do?
You only need to make the map static, because the map is static any
values inside the map will also be static (in effect).

john
Closed Thread