Hiya.
I'm attempting to make an algorithm that can draw the entities of my isometric game in the correct order. My entities are stored in a vector of pointers.
In the drawing function I first create a new vector of the same pointers, and then start with a for-loop that loops the amount of entities that I want to have drawn. Inside that...
Hi all,
When I try to install my msi package I get an error only in Vista and 7. "Error 1920. Service ... (...) failed to start. Verify that you have sufficent privileges to start system services"
I get this error in Vista or 7 if I build my setup with C++ 9 CRT Winsxs MSM merge module
If I use C and C++ 7 runtime libraries it doesn't...
Hi!
What is the best way to deal with something like this :
if(key==Space)
{
switch(weapon)
{
case GUN:
p->shotGun();
break;
case BOW:
p->shotBow();
break;
}
}
else if(key==Enter)
{
//...
}
else if(key==Up)
{
//...
}
...
Im using gluUnProject() to get the screen 2d coordinate in 3d world coordinate. I take 4 positions from each corner of the screen to get the area of visible objects.
How to check which points are inside that "rectangle" ?, i have no idea about the terms or anything. The image below shows what that "rectangle" looks like:
...
Hi,
I've a quite difficult problem to explain but I will try my best. I've made a custom drag-drop implementation to a win32 GUI based application. Due to limitations of the program I can't use the proper OLE drag-drop mechanism. Its okey, I made my own with mouse key tracking and it works so so. The only problem I can't solve now is t...
According to C++ standard :-
The name lookup rules apply uniformly to all names (including typedef-names (7.1.3), namespace-names (7.3), concept-names (14.9), concept-map-names (14.9.2), and class-names (9.1)) wherever the grammar allows such names in the context discussed by a particular rule.
Name lookup rules apply Before Overlo...
I've been searching for a while but couldn't find a definite answer to this apparently simple question: what is the default length of an int?
I know that by default, an int is signed. But is it short or long?
According to the "Fundamental data types"table found in the following page, an int is a long int by default (4 bytes).
http:...
I'm writing something in C++. I have 2 classes which I want to contain one into the other as in the folowing (these are just the header files):
//Timing.h
#ifndef _Timing_h
#define _Timing_h
#include "Agent.h"
class Timing{
private:
typedef struct Message{
Agent* _agent; //i get here a compilation problem
...
Hi,
Sometimes when I use the debugger to step through my code, it goes into some assembly code (I guess I've stepped into some system library code).
The question is, how can I skip over it and jump to the nearest c++ code of my project?
...
I have a stl set of integers and I would like to iterate through all unique pairs of integer values, where by uniqueness I consider val1,val2 and val2,val1 to be the same and I should only see that combination once.
I have written this in python where I use the index of a list (clusters):
for i in range(len(clusters) - 1):
for j in...
Possible Duplicate:
Possible for C++ template to check for a function's existence?
Do you know of any metaprogramming tricks in C++ that allow me to check whether a class has a specific method. I has been thinking about something like this:
template <class T, class Enable = void>
class A { ... };
// This version of the clas...
I am trying to rebuild a project from the clearcase vob and i get the following error code :
error PRJ0019 .
Any help is very much appreciated ..
thankyou
...
C++ Standard 3.9.1 Fundamental types
Objects declared as characters (char)
shall be large enough to store any
member of the implementation’s basic
character set. If a character from
this set is stored in a character
object, the integral value of that
character object is equal to the value
of the single character literal...
#include <iostream>
#include <fstream>
class obj
{
public:
int i;
friend ostream& operator<<(ostream& stream, obj o);
}
void main()
{
obj o;
ofstream fout("data.txt");
fout<<o;
fout.close();
}
This is the my code, am getting error.
error : ostream : ambiguous symbol.
any one can help me.
...
Does anyone know of a library which will assist in decoding cron style timings, i.e.
30 7 * * 1-5
Which is 7:30am every Monday, Tuesday, Wednesday, Thursday, Friday.
M.
...
Hi,
in my unit test framework, for some of the messages ( which are simply POD structures ) I need a method to compare two such messages ( structs ) for equality of all fields. That is if for example I have a message:
struct SExampleMessage
{
int someField;
int someField2;
char someField3[10];
};
I have a method that take...
C++
typedef struct someStruct {
int val1, val2;
double val3;
} someStruct;
someStruct a [1000] = { {0, 0, 0.0}, {1, 1, 1.0}, ... };
The only way to initialize such a table in C# I know of is to write something like
class SomeStruct
{
int val1, val2;
double val3;
public SomeStruct (int val1, int val2, double val3)
...
Hi,
The program I'm working on crashes sometimes trying to read data at the address 0xCCCCCCCC. Google (and StackOverflow) being my friends I saw that it's the MSVC debug code for uninitialized stack variable. To understand where the problem can come from, I tried to reproduce this behavior: problem is I haven't been able to do it.
Que...
Our code sucks. Actually, let me clarify that. Our old code sucks. It's difficult to debug and is full of abstractions that few people understand or even remember. Just yesterday I spent an hour debugging in an area that I've worked for over a year and found myself thinking, "Wow, this is really painful." It's not anyone's fault - I...
What is the best approach to achieve thread-safety for rather simple operations?
Consider a pair of functions:
void setVal(int val)
{
this->_val = val;
}
int getVal() {
return this->_val;
}
Since even assignments of primitive types aren't guaranteed to be atomic, should I modify every getter and setter in the program in th...