tomadom's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Active Members
Active Posts:
74 (0.12 per day)
Joined:
11-December 12
Profile Views:
1,224
Last Active:
User is offline Jul 21 2014 04:10 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   tomadom Is here

Posts I've Made

  1. In Topic: Placing a struct of an object in a header and source file ?

    Posted 20 Jul 2014

    This will be useful. Thanks
  2. In Topic: Placing a struct of an object in a header and source file ?

    Posted 19 Jul 2014

    View PostSkydiver, on 19 July 2014 - 10:33 PM, said:

    Try it out and see what the compiler tells you. I expect the only stumbling block you'll run into is the declaration of the the instance in your main, but the error message you get from the compiler should point you in the right direction.


    I'm not sure what you mean? Try what out?
    The example I provided was without the constructor arguments. I want to know how to go about this with constructor arguments?
  3. In Topic: buffer <<= 4 ?

    Posted 8 Feb 2014

    thanks
  4. In Topic: error: cannot convert 'int**' to 'int*' in assignment

    Posted 3 Feb 2014

    I think I've just clicked. Thanks for the help.
  5. In Topic: error: cannot convert 'int**' to 'int*' in assignment

    Posted 3 Feb 2014

    View Postjimblumberg, on 03 February 2014 - 10:16 AM, said:

    You are, remember tt is a pointer to a single int, not an array of int.

    Jim


    I thought that if I incremented an int like below, I am moving the memory location.
    For example the &int = 0x120 and if I increment it like this ++(*int) = 0x121 . Is this not the case? Each loop shows the same memory location.

    An example is provided below:

    Increment memory

    #include <iostream>
    #include <cstring>
    #include <cstdlib>
    
    using namespace std;
    
    int main()
    {
    
         int *tt = new int;
         int *p = new int;
         int mint = 665;
         tt = &mint;
    
     for (int i = 0; i < 10;i++)
        {
            ++(*tt);   //I thought this would increment the memory location of tt
     
          cout << &tt << endl; // I am displaying the memory location of
                              //   tt
    
        }
    }
    
    

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

tomadom hasn't added any friends yet.

Comments

tomadom has no profile comments yet. Why not say hello?