I noticed if I print out a long string(char*) using cout it seems to print 1 character at a time to the screen in Windows 7, Vista, and Linux(using putty) using Visual C++ 2008 on Windows and G++ on Linux. Printf is so much faster I actually switched from cout to printf for most printing in a project of mine. This is confusing me because...
I'm looking for a C++ logging framework with the following features:
logs have a severity (info, warning, error, critical, etc)
logs are tagged with a module name
framework has a UI (or CLI) to configure for which modules we will actually log to file, and the minimum severity required for a log to be written to file.
has a viewer which...
How to write bitmaps (RGB) as frames to H.264 with x264 in C\C++?
Some Examples with source would be great!
...
How to write bitmaps as frames to Ogg Theora in C\C++?
Some Examples with source would be grate!)
...
I am trying to implement a hash table
...
I have an xml file which holds a set of "game" nodes (which contain details about saved gameplay, as you'd save your game on any console game). All of this is contained within a "games" root node. I'm implementing save functionality to this xml file and wish to be able to append or overwrite a "game" node and its child nodes within the...
How can I wait for a detached thread to finish in C++?
I don't care about an exit status, I just want to know whether or not the thread has finished.
I'm trying to provide a synchronous wrapper around an asynchronous thirdarty tool. The problem is a weird race condition crash involving a callback. The progression is:
I call the thi...
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int twoify(int num, int times)
{
num *= 2;
if (times > 0)
{
times--;
return twoify(num, times);
}
return num;
}
int main()
{
srand(time(NULL));
const int BET = 1;
const int TIMES = 100000;
const int CHANCE = 50;...
I'm having some trouble creating an object in C++. I create a class called Instruction, and I am trying to create a new instance, but I get compiler errors.
Class code:
class Instruction{
protected:
string name;
int value;
public:
Instruction(string _name, int _value);
~Instruction();
void setName(string _name...
How can I compile C++ .cpp files in the Eclipse IDE. I have CDT installed but when I try to execute it, I get a "Launch Failed. Binary not found." I do not want to install CYGWIN unless it is absolutely necessary.
...
Are there any good and free C++ Game Programming eBooks for beginners? A PDF would be the best format.
...
For those who are using vim/emacs/terminals,etc (ie, not an IDE proper) what sort of projects are you working on? Are they big? Production? Are these the tools you use at work? Or mostly for smaller things...or big things broken into small things? Sorry...enough questions.
I ask because I'm studying computer science right now, and am su...
I have a general function that is supposed to handle any event in the SDL event queue. So far, the function looks like this:
int eventhandler(void* args){
cout << "Eventhandler started.\n";
while (!quit){
while (SDL_PollEvent(&event)){
cout << "Got event to handle: " << event.type << "\n";
switch (event.type){
...
Being faced with the question wether its possible to choose #includes in the preprocessor i immediately thought not possible.
.. Only to later find out that it is indeed possible and you only need to watch out for argument expansions (which e.g. Boost.Preprocessor can take care of).
While i'd avoid actually doing that for includes if po...
Hi I have two classes, one called Instruction, one called LDI which inherits from instruction class.
class Instruction{
protected:
string name;
int value;
public:
Instruction(string _name, int _value){ //constructor
name = _name;
value = _value;
}
~Instruction(){}
Instruction (const Instruction &r...
I'm trying to understand the differences between C and C++ with regards to void pointers. the following compiles in C but not C++ (all compilations done with gcc/g++ -ansi -pedantic -Wall):
int* p = malloc(sizeof(int));
Because malloc returns void*, which C++ doesn't allow to assign to int* while C does.
However, here:
void foo(void...
Hello,
Im trying to build an array based, "Binary Search Tree" by following the algorithm at:
http://highered.mcgraw-hill.com/olcweb/cgi/pluginpop.cgi?it=gif%3A:600%3A:388%3A%3A/sites/dl/free/0070131511/25327/tree%5Finsert.gif%3A%3ATREE-INSERT
Up until I need to realloacte, my tree resembles:
R
/
A
\
F
\
...
I have a list of type Instruction*. Instruction is a class that I made. This class has a function called execute().
I create a list of Instruction*
list<Instruction*> instList;
I create an Instruction*
Instruction* instPtr;
instPtr = new Instruction("test",10);
If I call
instPtr.execute();
the function will be executed correct...
I have several DLLs in my project that are defined to create their *.pdb file (debug info) inside the same folder. The problem is that the only *.pdb file that actually exist inside this folder is the one that belongs to the last compiled DLL. As a result I can debug only the last project (each compilation deletes all the *.pdb in the fo...
hi frnds,
i recently downloaded Microsoft Speech SDk 5.1 and i want to learn that how to use it. Please suggest me some websites and links where i can find tutorials on using it from basic using C# or C++.
thanx
with regards :)
...