Search:

Type: Posts; User: skreaminskull

Search: Search took 0.00 seconds.

  1. I actually got your first source code post to...

    I actually got your first source code post to work with a few modifications. First was to add a constructor call to rng.cpp ( aRandomNumberGenerator::aRandomNumberGenerator() ), second was to remove...
  2. Add a constructor call in rng.cpp after ...

    Add a constructor call in rng.cpp after


    using namespace std;

    aRandomNumberGenerator::aRandomNumberGenerator() {

    }
  3. You need to pass something to your setSeed()...

    You need to pass something to your setSeed() function...you have it defined as
    void aRandomNumberGenerator::setSeed(unsigned long) in rng.cpp. Something like this in main.cpp

    rand.setSeed(1);
  4. I think you are getting the first error, ...

    I think you are getting the first error,
    C2011: 'aRandomNumberGenerator' : 'class' type redefinition

    because you the way main.cpp is included rng.h and rng.cpp. Even though you have the header...
  5. Thanks Mats! Point well noted...I think I'm...

    Thanks Mats!

    Point well noted...I think I'm starting to get it.

    The way I am understanding this is that in the first code example, p2 is storing the the value of z in its own memory address...
  6. Thank you laserlight and matsp! Right, I was...

    Thank you laserlight and matsp!

    Right, I was trying to get p2 to be a pointer to z and get in some practice with malloc. With my misunderstanding of pointers though, I thought I needed to point...
  7. Program crashing on free() with an invalid pointer message

    Hello all,

    This is my first post...I'm just starting to learn C and going through some of the beginner tutorials at cprogramming.com. The following code is giving me an error at run time


    ...
Results 1 to 7 of 7