General C++ Programming - April 2012 (Page 4)

by Balrog
OpenGL glStencilFunc
 
I was wondering if anyone knew if it was possible to tag pixels drawn to the screen using the OpenGL graphics library's function glStencilFunc beyond the 1-255 ...
[no replies]
Problem with file reading
 
Hello, i have assignment and i have problems with completing it. I have to make a class with functions, to read from a text file byte by byte, and read every bi...
[1 reply] : You can use the binary operators to read the bits from a byte. operato... (by Peter87)
Call Function Every X Seconds?
 
Hello people, This should be simple enough but I can't seem to figure it out. Been up all night working with DirectX but thought I would post this here for s...
[5 replies] Last: Thank you Pravesh that cleared things up for me and the program is sou... (by GABsturr)
Possible help needed on creating a progra?
 
I am practicing my programming and I want to create a program that will display this: 1. Add 2. Delete 3. Sort 4. Find 5. Display All 6. Exit It need...
[1 reply] : What's the problem? Create two classes according to the requirements. ... (by Athar)
by dlh
Accessing inherited template functions
 
Hi, I am having some issues trying to access an inherited template class how I would like to. I have written out a simplified case of mine for completeness a...
[2 replies] Last: > In Foo, if I try and access Bar's "DoSomething()" function, I have t... (by JLBorges)
How address assigned to a pointer is actually destroyed?
 
When we perform a delete operation on a pointer, we actually are deleting the value pointed by the pointer and not the pointer itself(?). So after deletion, the...
[5 replies] Last: Each process has its own address space, so the address 0x22cd18 can b... (by incognito)
by Torin
Derived classes problem: 'undefined reference to vtable' linker error with derived classes
 
Hi, I'm beginning to work on a plugin framework for an application, which will work by dynamically loading shared/dynamic libraries that contain classes (unk...
[5 replies] Last: @clanmjc Okay, that makes sense. Thanks. (by Torin)
having a little problem
 
hello everyone, i have this program that is like an ATM. it ask the user to deposit or see the balancce it works fine but i do not how to show the balance that ...
[1 reply] : The not recommended way but easiest way would be to declare two global... (by vin)
Isn't reference a const pointer?
 
Well, Ideally, once initialized, a reference cannot be made refer to another variable because it, the reference is treated as a const pointer. I am a bit conf...
[5 replies] Last: My apologies. After declaration, I was actually trying r=j //instea... (by incognito)
c++ database index storage
 
I have a .txt file with 4 colums the first column is the primary key for my search to this file. I want to save to the same file an index based on B+ trees ...
[no replies]
How to use std::cout without a main in a file
 
Hi, I would like to know how i could use std::cout in a file that does not contains a class and which is a part of a project that contain already a main () i...
[8 replies] Last: You could put that code in your main and it would work... somewhat. ... (by MoonDragon)
by bfpri
SDL animation for tiles
 
So at the moment i have 32 x 32 tiles. I have a 32 x 32 sprite. I want the sprite to move from one tile to another in one go. That is one "right" click would...
[no replies]
rand and srand
 
can any one please explain the use and syntax of rand and srand....
[3 replies] Last: http://cplusplus.com/reference/clibrary/cstdlib/srand/ (by Pravesh Koirala)
serialize derived class object through boost::serialization
 
I want to serialize a derived class object through boost::serialization library. To test whether both the base and the derived class object have been serialized...
[no replies]
Randomness
 
Hi. I created a function that generates random number. I want to know is its randomness comparable to rand() function? How about performance? unsigned long...
[5 replies] Last: Thank you guys. I got it. (by majidkamali1370)
by seru
Allocating memory for a large number of objects at the same time where each object hold maps and vectors
 
Hello, I am writing some code which is time critical and I've noticed that memory allocation takes up a lot of time because I have to create an object up to 1,...
[12 replies] Last: > Am I missing something? Enabling optimizations (in particular, inli... (by JLBorges)
Help
 
Hello every body....i am having a little problem...i have written a program in c++ which takes two integers i and j and compute the sum of the numbers between t...
[4 replies] Last: can any one please explain the use and syntax of rand and srand.... (by awaise17)
by puerto
How can I get a rational cpp and rational.h from this?
 
Get a cpp and h from this code. #ifndef RATIONAL_H #define RATIONAL_H #include <ostream> using namespace std; class Rational { double num; doubl...
[no replies]
Glibc error, fail to open file
 
*** glibc detected *** a.out: double free or corruption (fasttop): 0x00000000016d62f0 *** Set is a custom class. Set readFile(Set In, char *name) { ifst...
[2 replies] Last: I debugged it and got a System.AccessViolationException. Any ideas? (by edithsong)
by snig
initializing an array after declaring it
 
I have to questions the 1st is: How can i initialize an array after declaring it. for example string test then somewhere else in the program how can i do somet...
[5 replies] Last: > How can i initialize an array after declaring it // declare the ar... (by JLBorges)
April 2012 Pages: 123456... 49
  Archived months: [mar2012] [may2012]

This is an archived page. To post a new message, go to the current page.