Thread: how can i use a static variable in private session of a class

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    a newbie :p
    Join Date
    Aug 2008
    Location
    Zurich, Switzerland, Switzerland
    Posts
    91
    Quote Originally Posted by Masterx View Post
    by the way now what should i do ?
    Code:
            CLA::CLA(map<int, string> str)
            {
                    InputString(str);
            }
    is it right?
    well, that's a constructor dude...it will be automatically run when you create an object of CLA.
    are you trying to assign member variable of a class to its own constructor?
    can't be like that...

    btw map is not that simple...
    check here: http://www.cplusplus.com/reference/stl/map/

  2. #2
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497
    Quote Originally Posted by auralius View Post
    well, that's a constructor dude...it will be automatically run when you create an object of CLA.
    are you trying to assign member variable of a class to its own constructor?
    can't be like that...

    btw map is not that simple...
    check here: http://www.cplusplus.com/reference/stl/map/
    ! about the first issue , you are right , ( tobe honest , i was thinking to disable constructor because i couldnt find a way to get it to work!

    and about the second one ! i dont understand it . even the simplest part of it ! what does it mean ! did i get into a serious problem by using mapped array?
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. uploading file to http server via multipart form data
    By Dynamo in forum C++ Programming
    Replies: 1
    Last Post: 09-03-2008, 04:36 AM
  2. Linking errors with static var
    By Elysia in forum C++ Programming
    Replies: 8
    Last Post: 10-27-2007, 05:24 PM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. Need help with calculator program
    By Kate in forum C# Programming
    Replies: 1
    Last Post: 01-16-2004, 10:48 AM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM