Search:

Type: Posts; User: redneon

Search: Search took 0.01 seconds.

  1. Yeah, I know. That's one of the changes I'm...

    Yeah, I know. That's one of the changes I'm wanting to implement. I don't think there's a single instance of the word "const" in this entire code. I was a naive young coder once :)
  2. I've removed the top seven lines from both files...

    I've removed the top seven lines from both files as that contains identifying information :)

    AmVector2.h:


    #ifndef _AM_VECTOR_2_H
    #define _AM_VECTOR_2_H

    namespace AmberMaths
    {
  3. Operator overloading compilation issue in GCC

    Just porting a small project of mine from Windows to Mac and I've hit a compile issue I'm a bit confused about.

    I used CMake to build an XCode project and when I try and compile my maths library...
  4. Replies
    9
    Views
    1,158

    Yeah, I know what you mean. I undertsand it's a...

    Yeah, I know what you mean. I undertsand it's a bad idea. It's just something about C++ I was unclear on.

    I missed the dereference on the this pointer :rolleyes:
  5. Replies
    9
    Views
    1,158

    Oops. So I did :) So, would... class...

    Oops. So I did :)

    So, would...



    class MyClass
    {
    MyClass()
    {
  6. Replies
    9
    Views
    1,158

    Not according to the C++ FAQ Lite. See here...

    Not according to the C++ FAQ Lite. See here: "Instead it calls Foo::Foo(char,int) to initialize a temporary, local object (not this), then it immediately destructs that temporary when control flows...
  7. Replies
    9
    Views
    1,158

    The example I gave was a bad one in that the...

    The example I gave was a bad one in that the function I'm using already has a return value so I have to pass in either a reference or pointer.

    What I don't understand is how come it's valid to...
  8. Replies
    9
    Views
    1,158

    Constructor Question

    I should probably know this, but I don't so I'm hoping someone can fill me in.

    If I create an object using the default constructor, then pass that object via reference into a function whereon it...
  9. Replies
    6
    Views
    2,094

    I'm asking what I could be missing from my...

    I'm asking what I could be missing from my interpretation of the bitmap file format. I've followed the documents I could find on the Internet and I appear to be following them to the T but I'm...
  10. Replies
    6
    Views
    2,094

    Yeah, that's what I'm already doing as I...

    Yeah, that's what I'm already doing as I mentioned in the original post :)
  11. Replies
    6
    Views
    2,094

    Really? I haven't read that anywhere. So,...

    Really? I haven't read that anywhere.

    So, currently the data block in my image is 17 (+1) x 9 pixels which makes it 162 pixels. Does this mean I could get away with just modding 162 by four and...
  12. Replies
    6
    Views
    2,094

    Programming with the bitmap file format

    I'm not sure if this is the right place to ask this but I couldn't think of anywhere else.

    I'm writing an app where I'm wanting to convert raw byte data into bitmaps. I did a bit of reading about...
  13. Replies
    21
    Views
    3,695

    Ah, right. I seem to remember reading something...

    Ah, right. I seem to remember reading something about this a while ago. Isn't there some kind of pragma directive I can add to stop it from doing this?
  14. Replies
    21
    Views
    3,695

    Struct size incorrect

    I've created the following struct...



    typedef struct {
    short type;
    int fileSize;
    short res0;
    short res1;
    int dataOffset;
  15. Thread: Swap Integers

    by redneon
    Replies
    61
    Views
    6,649

    Yeah, I get that. b doesn't actually contain a...

    Yeah, I get that. b doesn't actually contain a value. It contains the address of a. So when I increment the value stored in the memory address that b point to I am incrementing the value of a by...
  16. Thread: Swap Integers

    by redneon
    Replies
    61
    Views
    6,649

    Ah, I think I understand but I just want someone...

    Ah, I think I understand but I just want someone to confirm it.

    If in my main function I do this:



    int a = 100;
    int *b = &a;

    *b += 50;
  17. Thread: Swap Integers

    by redneon
    Replies
    61
    Views
    6,649

    Ok. I'm a little confused about pointers then. I...

    Ok. I'm a little confused about pointers then. I understand references now but take the following code:



    void inc(int *val)
    {
    *val++;
    }

    int main()
  18. Thread: Swap Integers

    by redneon
    Replies
    61
    Views
    6,649

    I think that's a little subjective. Even so, I AM...

    I think that's a little subjective. Even so, I AM using references. See: swapInts(&firstInt, &secondInt);



    A thought a reference was literally the address of the variable? So it essentially...
  19. Thread: Swap Integers

    by redneon
    Replies
    61
    Views
    6,649

    You're right. It was swapInts(&firstInt,...

    You're right. It was swapInts(&firstInt, &secondInt);



    If that's the case then why does it work in the function? If I do...

    int firstInt = 1;
    int secondInt = 2;

    ...and say the address'...
  20. Thread: Swap Integers

    by redneon
    Replies
    61
    Views
    6,649

    Swap Integers

    I have to write a function that will swap the value of two integers around. The definition for the function is swapInts(int *firstInt, int *secondInt);

    As it's address' that's being passed in I...
  21. Replies
    2
    Views
    4,988

    Count Number of Digits in and Integer

    Does anyone know if it's possible to count the number of digits in an integer? One of my friends recommended log10 or something but I can't figure it out.

    Redneon
Results 1 to 21 of 21