General C++ Programming (Page 2)

by tmason
Speed of Basic Arrays Versus Vectors ...
Hello, A little exersize I did recently which essentially compares the speed of arrays versus vec...
[5 replies] Last: I wanted to measure usage of real world classes with constructors/des... (by dhayden)
by chhe
normal distribution
I wrote the following program shown below that produces a normally distributed random number several...
[2 replies] Last: The default seed is usually no good. You can use std::time to seed the... (by Peter87)
Singleton implementation
I'm playing with the idea of a singleton base class, but I'm having an issue with how to implement t...
[12 replies] Last: dhayden, it's not a good idea to use static data members like that - t... (by LB)
Question regarding returning an std::weak_ptr vs std::shared_ptr
So as the title suggests I was wondering about the different cases where it would be preferable to r...
[3 replies] Last: std::weak_ptr models temporary ownership: when an object needs to b... (by JLBorges)
getline skipping first line
text file is hello there void readFile(char , ifstream&); address records ; int main(){ ...
[6 replies] Last: You can check by opening a terminal and typing od -c foo.txt (repl... (by Duoas)
Better way of doing this?
I am wondering if their is a better way to do this void ItemHandler::addGroundItem(unsigned shor...
[6 replies] Last: It looks like item_drops is a vector. The way you're using it here, ... (by dhayden)
by god657
Airport Simulation NEed Help!!
HI! I am a beginner for C++. I need help for an airport simulation where user can add, delete and ed...
[no replies]
Anyone can give me a link the solution of object oriented programming with c++ by balaguruswamy and...
[2 replies] Last: Please give current link (by mdrocky)
Problems with class files with SFML
Im making a small game is SFML called skelton town. (not skeleton (its a inside refrence)) I have ma...
[2 replies] Last: As ne555 pointed out the sf::RenderWindow member is not related to the... (by Z e r e o)
variable inside constructor
automatic variables are destroyed upon function exit what about variables created inside constructor...
[1 reply] : All variables declared in a constructor go out of scope when the const... (by helios)
Read certain lines from a file
I want to read certain lines from a file. Let say if the line contains word "makes" , the line will...
[1 reply] : (by keskiverto)
by cGuru
Can You Recommend An IDE?
So, I have just started my college C++ course, and on my book companion website it recommends severa...
[6 replies] Last: I prefere Qt Creator. When I first saw it I fell in love with it (sorr... (by Zloi)
Differentiate a word/letter and number in a string
I have one string from user. Let say, "The deviceId is 2" ....but user also can give input like t...
[1 reply] : (by LB)
Shared pointer problem
Hi I made a vector of shared pointers and when I set the pointer to NULL it should delete the memory...
[3 replies] Last: If you choose to ignore what I am saying, I cannot help you. (by LB)
by judo11
How to dry run any c++ programs?
I've noticed that in order for us to understand any program is by dry running it using a pen and pap...
[8 replies] Last: you mean like an IDE? (by Homberto)
reading xml weird error
hello I am trying to read this xml file this readFile function does not give me right values. Only...
[8 replies] Last: Pls tell me what to do in taglessline function void readFile(char ... (by csstudent123)
Smart pointers in a vector
I am new to smart pointers and have a question. If you push a smart pointer onto a vector and the...
[1 reply] : Yes. (by Disch)
Boost memory mapped object
i've created dll and implemented shared memory that every connected process can use. My problem is t...
[3 replies] Last: Ah, yes. Sorry, I missed that the first time. static globals are tran... (by helios)
C++ count an array?
This is going to seem like a stupid question but how can I count the elements of a const array. Sure...
[2 replies] Last: Using sizeof with class member arrays does give the length. sizeof(arr... (by helios)
by pluk
sdl memory leak!
hello! i have a memory leak in my game and i can't find the problem. here is my code(its a mess) :...
[2 replies] Last: My first question would be how you determined a memory leak exists. (by helios)
Pages: 1234... 44
  Archived months: [jun2014]

Cannot post in this page. To post a new message, go to the first page.