Are you trying to do this with OpenGL?
Type: Posts; User: threahdead
Are you trying to do this with OpenGL?
Please have a look at how to define functions in C++:
<return type> <function-name>(<arguments>);
If the functions you implemented are not static, you first need to create an object of that...
Yes, if its preallocated, this should work, too.
fread() takes a void pointer. So the procedure to do this would be to allocate enough space and then call fread() once.
After you read the data you can cast the structure over it and get the values...
Try creating the C++ project as an empty project. This can be done in the C++ project creation dialog.
A dynamic_cast is safer than static_cast because it checks at runtime wheter the cast is allowed.
See dynamic_cast [C++ Reference] and static_cast [C++ Reference]
Thanks for all your input, it helped me alot!
Thats pretty much what i need to do.
But you're saying i should do it at runtime, although i know the types at compile time?
What i have in mind is something like this
template<class Type>...
Hello,
suppose i have something like this
class Storage
{
public:
Storage(int storageType)
The line marked in red is assigning a char * to a char. This will get you a compile time error.
You should, like Salem said, use C++ streams and std::string for the studentlist.
You will need an array of 12 x nParseCount, which basically is a
const int bufferSize = 12;
unsigned short **naaLeadBuffer;
naaLeadBuffer = new unsigned short *[bufferSize];
for(int i = 0;...
You cannot create the array naaLeadBuffer with the size nParseCount. The size in the [] brackets has to be known at compile time.
Try using the new operator instead and allocating the memory...
template<typename T>
class Base
{
public:
Base(void) {};
~Base(void) {};
};
template<typename T>
class Derived : public Base<T>
You should get a compiler error because var needs to be a pointer to a class1 object.
class1 *var = new class1();
As far as i know, my_class should be deleted too, when you delete an...
Hi,
converting to BMP might be alot easier than to convert to JPEG. See BMP file format - Wikipedia, the free encyclopedia for a detailed description of how the headers of the BMP file have to...
I remember i had to program a backgammon game once with ASCII output.
You should have a data structure set up, that represents the placement of the stones. If it were to be a 2D Matrix you would go...
Hi, could you be a bit more specific about your problem? Posting your source code might be a good idea too.
Absolutely.
But using structs, or something similar, is easier to grasp though. There is no need to understand how a number is represented in binary for that.
wrong thread? ;)
A hint, take a look at structs.
I totally confused a NULL pointer with a value of 0 inside the array when i posted this.
Thanks for all your input!
Actually i was a bit zealous to change everything to const correctness after reading about it. This doesn't make sense in this case where my getters should be returning...
Yes.
After this assignment, you can index x from 0 to 1999.
Another way to put it is to say now you have 2000 doubles allocated in memory which must be deleted afterwards again with
delete [] x;
Hello,
with the const correctness chapter of the C++ FAQ in mind, i think about redesigning my getters.
I have the following code example:
template<typename T>
class Container
{