Glad I finally got it! ^_^
Type: Posts; User: Tesp
Glad I finally got it! ^_^
Those all gave me 16. And when I tried to store their actual sizes in vars, I got this:
Since chars take up one byte each, floats take up four bytes each, and doubles take up eight bytes each,...
Yes, I understood that part. Is there anything else?
So what you're saying is that if I want sizeof to work with a pointer to a collection, I need to use the pointer to pass a single element of said collection. One way is to dereference the pointer and...
So basically, if my data collection is on the stack, I pass it to sizeof as the size argument, since sizeof can work with that.
If it's on the heap, I have to pass the combined amount of space...
As I mentioned in the OP, I already tried dereferencing the pointer. Didn't work.
So basically, glBufferData only works with regular arrays with hard-coded lengths?
I’ve been following this OpenGL tutorial, which uses GLFW with OpenGL 3.3. After finishing it, I changed the code so that the vertices variable is a float pointer instead of an array. Like so:
...
I've been following the beginning OpenGL tutorial on this site, and am on this part. I copypasted the code into a new project in Visual Studio 2015, tried to run it, and got this error under the...
Well, if C++ is enough to make games like Call of Duty or Kingdom Hearts 3, then it's definitely enough for something as simple as a Tetris-style game :)
I’ve been having trouble understanding what Chapter 28, Exercise 3 of Jumping into C++ is asking of me. The description is as follows (warning: it’s rather long):
When it says “when a...
I know this is a bit late, but I figure I should add my two cents.
I'm not looking to program game engines, or do stuff in assembly; I just want to learn programming to make games (and perhaps...
I tested as I said, and everything seems to work perfectly! So, thanks to all of you who helped :)
Understood about the processors and behavior definedment, Hobbit :) I'm not familiar with how processors work (not much beyond them being computers' brains, anyway), but I'll look into them.
I see what you mean about the pointers; it explains why merely setting secondIter past endOfHaystack caused a crash; endOfHaystack is the last element + 1, and thus the last valid point to point to. ...
I don't see how :/
Oh, like what happens when you try to access element 5 in an array with only three elements.
I know what a processor is; I don't know how you came to think I didn't :/
Hm, perhaps.
Alex Allain's Jumping into C++ says something to that effect, on page 58. Quote:
Oh, I see. I feel silly for not realizing that before ^^;
And yes, I know that secondIter can point to any point after the end of a container. What I want to know is why it crashes in this one...
I was working on an assignment from Alex Allain's Jumping into C++, Exercise 1 of Chapter 19. The user enters a bunch of text (a "haystack"), then enters some other text (a "needle"). The program...
Oh, I see. The reason I insisted on using an 8-bit int is based on the advice about using datatypes no bigger than you'd need. I know that today's computers are powerful enough to, for the most part,...
My code is:
int8_t num;
cin >> num;
cout << num + 0;
In that case, what would be the point of using 8-bit ints instead of regular ones, if I just have to cast to the larger data type?
So, for an assignment in Alex Allain's Jumping Into C++, I was supposed to make a high scores program. It works just fine, except it doesn't work with 8-bit integers (or int8_t, as the compiler...
Though, in the book, the sort itself was specifically referred to as an insertion sort (which made things confusing). :/ I'll read up some to better grasp the difference, to see what I can do for...
It said:
Except that the insertionSort shown in that same chapter already does that. Have a look:
void sort (int array[], int size)
{
for ( int i = 0; i < size; i++ )
Oh, that one. All right, thanks :)
The problem:
I looked through a bunch of the previous chapters (even Chapter 1), but nothing came up about a guessing game. Was this a mistake, or did I miss something?