General question for programmers

General technological topics without their own forum go here

Re: General question for programmers

Post by -Ninjex- on Mon Jan 28, 2013 8:51 pm
([msg=72851]see Re: General question for programmers[/msg])

:: Refers to global scope

However if you use : ::
The first colon : is a indication that what will follow is an initializer list. This can appear in a class's constructor as a way to give that class's data members an initial value before the body of the constructor executes.

A small example

Code: Select all
class Foo {
    Foo() :
        x(3),       // int initialized to 3
        str("Hey!"), // std::string initialized to be the string, "Hey!"
        list(5)    // std::vector<float> initialized with 5 values
    { /* constructor body */ }

    int x;
    std::string str;
    std::vector<float> list;

-- Mon Jan 28, 2013 8:53 pm --

I highly suggest just to learn the language, I think you may end up confusing yourself...
Spreading knowledge just once a day, can help keep the script kiddies away ⠠⠵
no_hope if{|person, ic = 0| ic +=1 if ignorance.include?(person)}.compact.length > (world.length / 2)
The absence of evidence is not evidence of absence.
User avatar
Posts: 1061
Joined: Sun Sep 02, 2012 8:02 pm
Blog: View Blog (0)

Re: General question for programmers

Post by KthProg on Mon Jan 28, 2013 10:00 pm
([msg=72860]see Re: General question for programmers[/msg])

lol ill be learning it next semester.
at which point i will proceed to confuse myself lol
User avatar
Posts: 219
Joined: Wed Jan 23, 2013 7:06 pm
Blog: View Blog (0)


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests