TwoOfDiamonds's Profile User Rating: -----

Reputation: 38 Craftsman
Group:
Active Members
Active Posts:
202 (0.68 per day)
Joined:
27-July 12
Profile Views:
2,598
Last Active:
User is offline Mar 18 2013 09:11 AM
Currently:
Offline

Previous Fields

Country:
RO
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0
Icon   TwoOfDiamonds is wrestling with the keyboard.

Posts I've Made

  1. In Topic: unable to open include file 'stdio.h'

    Posted 5 Mar 2013

    I don't think the symbols are the problem ... or at least they shouldn't since if you write <stdio.h> the compiler will look into the include directory of the compiler directly and if you use "stdio.h" it will first look into the folder of the program and if it doesn't find it there it will look in the compiler's include directory .

    In my opinion, biggest chances are that there's something wrong with the compiler or the IDE settings :)
  2. In Topic: C++ program to solve a soduku puzzule

    Posted 1 Mar 2013

    A way to do this could be backtracking :) However, I'm not sure if it's the best solution :)
  3. In Topic: Initializing a 2D array in a class

    Posted 28 Feb 2013

    View Postjimblumberg, on 28 February 2013 - 08:06 PM, said:

    In future don't alter your previous posts to add or remove content, just post the changes.

    My question is why did you create the default constructor at all? Since you don't have any other constructor, and you're not really doing anything with the one you created, let the compiler create the default constructor for you.

    Jim


    It was created automatically by the IDE and forgot to delete it, I know it has no purpose that's why I didn't add it in the first place ...

    And thanks for the advice :)
  4. In Topic: Count to a million

    Posted 28 Feb 2013

    12351.

    Seriously large typo >.</>
  5. In Topic: Initializing a 2D array in a class

    Posted 28 Feb 2013

    View Postbaavgai, on 28 February 2013 - 03:04 PM, said:

    Now I have to ask. On what wonky compiler does this work?
    [baavgai@DIC]$ cat a.cc
    #include <iostream>
    
    using namespace std;
    
    class level
    {
        public:
            level();
    
            int arr[25][25] = {{4,6,4,21,5134,3},
             {6, 4, 123, 543, 123, 13} ,
              {5,23,65,1,2,3},
               {1,2,4,0,0,2},
                {543,23,234,124,12,45} };
    
        protected:
        private:
    };
    
    
    int main()
    {
        level Lvl;
    
        for (int i = 0 ; i < 5 ; i++)
        {
            for (int j = 0 ; j < 5; j++)
            {
                cout << Lvl.arr[i][j] << " " ;
            }
    
            cout << endl;
        }
    
        return 0;
    }
    
    [baavgai@DIC]$ g++ a.cc
    a.cc:10: error: a brace-enclosed initializer is not allowed here before ‘{’ token
    a.cc:14: error: ISO C++ forbids initialization of member ‘arr’
    a.cc:14: error: making ‘arr’ static
    a.cc:14: error: invalid in-class initialization of static data member of non-integral type ‘int [25][25]’
    a.cc: In function ‘int main()’:
    a.cc:29: error: ‘class level’ has no member named ‘arr’
    [baavgai@DIC]$
    
    


    That's what I'd expect. In C++, you can't normally have raw little initialization bits floating about in a class. That's what constructors are for.


    I haven't copied the level.cpp file since it only had the constructor . Which I thought it's not important for the example. And it's Code::Blocks :)

    I'll edit the first post and add level.cpp too :)

My Information

Member Title:
D.I.C Head
Age:
18 years old
Birthday:
June 27, 1994
Gender:
Location:
Ploiesti, Romania
Full Name:
Daniel Alexandru Radu
Years Programming:
2
Programming Languages:
C, C++ , Java

Contact Information

E-mail:
Click here to e-mail me
Facebook:
http://www.facebook.com/radu.daniel.940
Twitter:
HakunaThePumba

Comments

Page 1 of 1
  1. Photo

    TwoOfDiamonds Icon

    30 Aug 2012 - 23:23
    xD I will , I tried to install Ubuntu in parallel to XP , xD kinda screwed up the Windows , but now I'm back :D
  2. Photo

    fromTheSprawl Icon

    30 Aug 2012 - 20:14
    Not really thanking, more of speaking about it. It's in the Caffeine Lounge. Why not hang out there? It's the most fun forum here. ^^
  3. Photo

    TwoOfDiamonds Icon

    29 Aug 2012 - 00:39
    Thanking for rep ? :P
  4. Photo

    fromTheSprawl Icon

    28 Aug 2012 - 19:59
    Nah, I was just kidding, you do know what you did though? Just keep on helping. ^^
  5. Photo

    TwoOfDiamonds Icon

    28 Aug 2012 - 01:46
    Ooops :(
  6. Photo

    fromTheSprawl Icon

    28 Aug 2012 - 01:44
    Hey dude, you broke the first rule of Fight Club!
Page 1 of 1