Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > static var and static map

Reply
Thread Tools

static var and static map

 
 
Gary Wessle
Guest
Posts: n/a
 
      02-19-2007
Hi

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

thank you
 
Reply With Quote
 
 
 
 
Gary Wessle
Guest
Posts: n/a
 
      02-19-2007
Gary Wessle <(E-Mail Removed)> writes:

>> Hi

>
> I have a method with some static double variables, if I make a
> map<string,double> instead, 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,int> m;
static int a = 5;
m["a"] = 5;

or just
int a = 5;
will do?
 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      02-19-2007
Gary Wessle wrote:
> Gary Wessle <(E-Mail Removed)> writes:
>
>
>>>Hi

>>
>>I have a method with some static double variables, if I make a
>>map<string,double> instead, 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,int> m;
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the difference between "mytype* var" and "mytype * var" daniele.g C Programming 4 07-15-2011 05:48 PM
difference between @var and self.var Shea Martin Ruby 2 06-22-2006 04:55 PM
Difference between Session["var"] and Session("var") thomson ASP .Net 10 06-20-2005 01:02 PM
Difference between Session["var"] and Session("var") thomson ASP .Net 0 06-20-2005 10:54 AM
Invoking constructor : Foo(var) and Foo ins(var) Alex Vinokur C++ 4 09-24-2003 04:01 PM



Advertisments