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 :)
Type: Posts; User: redneon
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 :)
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
{
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...
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:
Oops. So I did :)
So, would...
class MyClass
{
MyClass()
{
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...
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...
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...
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...
Yeah, that's what I'm already doing as I mentioned in the original post :)
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...
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...
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?
I've created the following struct...
typedef struct {
short type;
int fileSize;
short res0;
short res1;
int dataOffset;
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...
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;
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()
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...
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'...
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...
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