General C++ Programming (Page 5)

std::string& input function throws bad memory allocation exception
 
I have to write a program for LearnCPP that uses a for-each loop to search through a fixed-size arra...
[16 replies] Last: FWIW, I think it's a bad practice in C#, as well. It's just harder to ... (by helios)
Huffman compression
 
Create a simple class named Tally. Data members should include an array of 256 integer counters, for...
[2 replies] Last: Okay. I did it. Now what? (by Disch)
subroutine & pointers help!
 
I created a program based on the instruction below, but do not know about this pointer, subroutine a...
[3 replies] Last: Thank you so much. I will look at this and learn it. My coding did e... (by mildredx)
type error in struct?
 
Below I am getting the compiler error: src\main.cpp:7:2: error: 'Card_Ranks' does not name a type ...
[4 replies] Last: Forward Declarations (by RUNNER PRO AGARIO)
Application crashes in Debug mode, but doesn't in Release mode
 
Hi. As a test, I'm using this code #include <iostream> #include <conio.h> #include <string> usi...
[2 replies] Last: I'm using VC++ compiler, not GCC. And yes, it warns me but in Debug m... (by gedamial)
std::array out of range error in simplified Blackjack game code
 
On LearnCPP, there's an exercise asking to play a simplified version of Blackjack. I was having tro...
[18 replies] Last: I'll try calling the printCard() and printDeck() functions in main(). ... (by DragonOsman)
Vector is loading values (int) that it should not
 
I have written a program that asks the user to input integers 10-100, inclusive, and load them into ...
[1 reply] : validateValues does more than just validate a value (why is it plura... (by cire)
I need to make this program shorter
 
I have this program #include <iostream> // cin, cout #include <string> // strings #include <...
[1 reply] : I suggest some functions. Try to reduce the code duplication. Also I... (by jlb)
What do you think of my SDL2 program so far?
 
Hi everyone, I started learning C++ last month. I've learned enough basics to begin working with ...
[3 replies] Last: Why make the SDL_Event object a a local variable in game loop instead... (by Peter87)
Please Help !
 
The C++ syntax has real molested me. I am completely stuck. For those who has assisted me before and...
[9 replies] Last: One of the goals of a database is to not read all the records into m... (by dhayden)
Copy constructor gets called instead of inizialier_list<> constructor
 
Hello. struct Foo { Foo() { cout << "default ctor" << endl; } Foo(std::initial...
[5 replies] Last: because i'm explicitly converting the floating-point number no, it c... (by Cubbi)
C++ delay() problem
 
Hi guys, I am trying to make a program that output "Loading", then delay for 1 sec, then output "."...
[4 replies] Last: @Kinyo356: http://codereview.stackexchange.com/questions/42506/using-... (by cire)
My static library project is somehow related with my 'test' project
 
Hello. I've made my own Static Library project on Visual Studio. The problem is this: unless I...
[10 replies] Last: Thanks to everyone ;) (by gedamial)
problem in POPPING ARRAY QUEUE
 
#include<iostream> #include<stdlib.h> #include<conio.h> using namespace std; const int s=50; int...
[2 replies] Last: Yes you are right. Thanks. (by gaurav97)
bubble sort error
 
#include<iostream> using namespace std; void swap(int&a,int&b) { int temp=a; a=b; ...
[5 replies] Last: THIS IS A SIMPLE VERSION OF YOURS. HOPE IT HELPS... #include<iostream... (by Kinyo356)
by kalki
Finding out no of 1's in a given no ??
 
How to find number of bit set in any given number ? Say int x=7; Number of 1's set in x are 3
[1 reply] : In three steps: 1. Your number mod 2 to get the final bit's value. 2. ... (by TwilightSpectre)
Unresolved issue
 
I get the error 1>Rpn.obj : error LNK2019: unresolved external symbol "public: void __thiscall Qu...
[9 replies] Last: Ok. make elements of type float then :+) And make Queue::add ac... (by TheIdeasMan)
Error Vectors out of range
 
The error says Error: Vector subscript out of range i have 3 chosen for k, i do not see how it is o...
[1 reply] : Hi, You are using n (= 10) in the for loop, but numbers only has ... (by TheIdeasMan)
Double Digit sort issues
 
In the code below I have created a simple bubble sort algorithm. It works for the most part but for...
[2 replies] Last: Right, that makes sense, thanks (by AgentNoise)
Vector Inventory problem fixed
 
This is my implementation of a vector based inventory system. I had a lot of help from AbstractAnon,...
[12 replies] Last: So after some tinkering i have found that it is better to use pointers... (by NoviceNate333)
Pages: 1... 34567... 28
  Archived months: [dec2015]

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