By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

static var and static map

P: n/a
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
Feb 19 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Gary Wessle <ph****@yahoo.comwrites:
>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?
Feb 19 '07 #2

P: n/a
Gary Wessle wrote:
Gary Wessle <ph****@yahoo.comwrites:

>>>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
Feb 19 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.