General C++ Programming - February 2016 (Page 10)

Program that will Arrange Three Numbers in Descending Order
 
Can you please help me in my problem.? The problem is "error else without a previous if" in line 33 and 46 here is my code! #include<stdio.h> main() { ...
[1 reply] : First: please use code tags and indentation. They make code easier to ... (by keskiverto)
Allocating large amounts of data on the heap
 
If something I understand is fundamentally wrong (which is quite likely), please correct me. I'm creating a program which impersonates that of the heap. In...
[1 reply] : So if I only need an array of size 50 bytes, the operating system wil... (by helios)
by dn90
Undefined reference to 'WinMain@16'.
 
Sample.h: #ifndef _SAMPLE_ #define _SAMPLE_ #include <cstddef> using namespace std; template <typename Object> class Sample { public: explicit ...
[2 replies] Last: It looks like your project was somehow mis-configured to be a Windows ... (by xismn)
Reading contents of an array horizontally?
 
Now, what i need help with is how to being able to insert the string into the array and be able to read it HORIZONTALLY instead of vertically. How do i outp...
[19 replies] Last: Having a good idea on how it works is a great start, putting it to cod... (by TarikNeaj)
Vector "out of range" error in a simple program storing words inputted into a vector
 
I am trying to store user input all words a user inputs into a vector, with each word being an element. The user can input as many lines of words as he wants, a...
[5 replies] Last: Aren't you slighly double-posting. First thread: http://www.cplusplus... (by keskiverto)
Need help in this code
 
#include <iostream> #include <string> using namespace std; class Employee{ public: Employee(); void Set_Name(); string Get_Name(); void Set_ID(); int Get_ID()...
[4 replies] Last: You have 2 constructors--1 default constructor (taking no arguments) a... (by doug4)
Random shuffle, pairing of objects using string attribute
 
How to use random _shuffle(), to pair up object/instance using its string attribute? Thanks in advance! void game1(void) { srand(time(nullptr)); const...
[1 reply] : template < typename T > std::vector< std::pair<T,T> > make_random_pai... (by JLBorges)
by Sam786
need help
 
I need a program that asks the user to enter integers as inputs to be stored in the variables 'a' and 'b' respectively. There are also two integer pointers name...
[1 reply] : If you want someone to do it for you post in the job section. We don't... (by TarikNeaj)
Linked list operator and clear function error?
 
I am having an error in my linked list in which once I use the overloaded + operator to add link lists together it kind of uh doesn't work, sort of? By default ...
[1 reply] : Also I think this is because linked list are pointers and thus they a... (by coder777)
Using stacks to check if an array is a palindrome
 
I'm doing an assignment for class and I'm completely lost. The assignment is "Write a program that evaluates a sentence to see if it is a palindrome. Use cla...
[1 reply] : Take a look here: http://www.cs.bu.edu/teaching/c/stack/array/ in or... (by coder777)
How do I do a key press function?
 
I just started learning c++ a couple of days ago, and I have been searching the internet all day today but I cannot find anything about this. #include <iostr...
[3 replies] Last: It could look something like this: #include <iostream> #include <Win... (by Vestergaard)
How can I write 200kb faster?
 
Hey guys. I'm currently working on a program that extracts text from a specific game. The program works but it is extremely slow. If I try to extract 200kb of t...
[1 reply] : What is the meanon of the recursion on line 48? You get the same byte... (by coder777)
RSG using grammars
 
I'm a Junior at a university in California. My 1st assignment for my Data Structures class is to create a random sentence generator using grammars and vectors ...
[1 reply] : The definition class is an entire grammar [...] but when I code that,... (by helios)
Find the reason: why not an compilation error?
 
template<bool> class CompilationError; template<>class CompilationError<true> { public: template<class ...Args> CompilationError(Args...) {} }; #defin...
[2 replies] Last: Many thanks! CompilationError<condition>(ERROR##message()); can be ch... (by Wu zhen hai)
Help with Age Class Program
 
Fairly simple program to calculate someones age, mostly done just can't figure out the last part. Any help is appreciated. This is my first forum post btw, I'm ...
[3 replies] Last: You're very welcome! anytime =) (by TarikNeaj)
Resaving an executable
 
I have a simple question and hope someone can help me with a simple answer. Suppose I have a compiled C++ executable called 'running.exe', and run this .exe on...
[2 replies] Last: Thanks for your kind reply. I was curious to know. (by glasses)
Add elements in vector
 
Hi! i'm new to c++, i'm trying to make a for to add elements in my vector, those elements are a custom object named Peer. i'm using Visual Studio 2015, Win32 P...
[7 replies] Last: In the code you showed us, here: Class Peer{ public : const... (by Moschops)
How should I return a large class object from a function?
 
Hello. If I have a class, for example a LinkedList, and I want to create a function called Reverse() which returns a new just created LinkedList object which h...
[2 replies] Last: Oh thanks for the tip! I've just read page 517 from Bjarne Stroustrup... (by gedamial)
What else to add to a Sudoku program?
 
Hi all. I wrote a Sudoku program that shows a graphical representation of the board on screen. Here's what's in the program already.. 1. > You move the cursor ...
[3 replies] Last: @TwilightSpectre Maybe random board generation Yes, that sounds li... (by whitenite1)
Sorting C-string arrays
 
Hey guys, I'm just making a general program that I make for every subject to practice my skills, substituting for given chapter, pointers, arrays, etc.. Well I'...
[1 reply] : getId(...) is invalid. Never return a pointer to a local variable. Ins... (by coder777)
February 2016 Pages: 1... 89101112... 21
  Archived months: [jan2016] [mar2016]

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