I don't know if you actually want to write this or if you just want a parser, but in the latter case you could consider looking at Flex and Bison. They are parser generators and are fairly easy to...
Type: Posts; User: jarro_2783
I don't know if you actually want to write this or if you just want a parser, but in the latter case you could consider looking at Flex and Bison. They are parser generators and are fairly easy to...
it's M_PI
well that's handy to know.
The pointers will only ever be an array of three or four elements. I'm allocating that with a function (setNumVertices) which allocates the pointers. Then in a loop I...
don't worry, it's more effort than it's worth even if it is possible. I get what you're saying about a third object storing references, that would probably work. But I can just do it with a function...
I didn't think it would work. I was playing around with it and it wasn't quite working.
I could just do what you said either with a function of just directly.
I think you misunderstood my design....
I have two structs:
struct FaceVertex {
float u;
float v;
int vertex;
};
If class and struct are exactly the same except that a struct's members are public by default and a class' members are private by default, what is the difference and how do I decide to use one over...
also,
<stdio.h> and <iostream> are the c and c++ versions of console output. You probably only want to use one of those and not both.
it still runs:
gcc -o birthdays birthdays.o
I don't get it, it should know that it's up to date shouldn't it?
that's strange, I can't see why it wouldn't work.
Of course if you are reading multiple things in you will need to keep track of which element in the array you are up to, so you will need to do
...
you need to do
if(fgets(arrayA[0], sizeof(arrayA[0]), stdin) != NULL)
because arrayA is type char**, fgets is expecting type char*.
sizeof(arrayA) will give you the whole 2d array, you...
oh yeah, you're right.
An interesting thing to note though, because of the way arrays are stored you get this:
#include <stdio.h>
int main(int argc, char **argv) {
you even put in your comment
//while char is not '(' and not end of string, increase index
make it && and it should work.
Also with this line:
while( str[index] != '\0' && str[index++]...
no that's wrong as well.
arrayA[0][0] gives the first element, so &arrayA[0][0] just gives the address of the first element.
*arrayA dereferences the address arrayA points to, which is the first...
We're using "Programming, Problem Solving, and Abstraction with C" by Alistair Moffat at uni.
It's extremely good, it is a from scratch book. It has lots of good diagrams and lots of code. It...
no that's incorrect.
arrayA == &arrayA[0].
also, *(arrayA + 1) == arrayA[1];
An array is just a pointer to the first element in the array. So *arrayA is the first element.
I have a problem with make, sometimes it remakes targets even when nothing has changed.
This is the simplest makefile that the problem happens on:
all: birthdays.o
gcc birthdays.o...