General C++ Programming - April 2015 (Page 20)

by anup30
qsort() 2d dynamic array
 
ascending sort. rows wont be sorted internally. comparison of row n and row m: if row < row row precedes row if row > row row precedes row if row ...
[1 reply] : solved. // #include <iostream> #include <cstdlib> // qsort using nam... (by anup30)
Source-based or binary-based library?
 
Hello, I currently working on a general library and I'm wondering if I should distribute it to be used as source (like the boost library) or use precompiled lib...
[2 replies] Last: Thanks for the fast reply, all the headers are include guarded. So the... (by Cube777)
sprintf outputting a char array
 
In my class we have a server and a client and we send information between the two. For this program is a memory game. The card game where you have 14 cards in f...
[6 replies] Last: With that few lines of code it's rather a guessing game... You send s... (by coder777)
Shallow and Deep copy constructors
 
Hi, I'm having trouble writing a shallow and deep constructor for 2 arrays that demonstrate the differences between shallow and deep copies. I think I have the...
[7 replies] Last: No, that would be a deep copy You would simply do myShallowCopyArray ... (by ne555)
Need help with main function.
 
Basically my whole program is comprised of 2 class definitions in header files along with the cpp files for each class.. Now all I have to do is the main funct...
[4 replies] Last: You should put your code in code tags! int main() { //Readable! ... (by Mats)
Quick C++ stack vs heap memory
 
In the following scenario: class SubObject { public: list<string> myStringList; SubObject(); ~SubObject(); } class MainObject { ...
[2 replies] Last: I added the output statement to the constructor. It does get called. ... (by Aztecs1)
by Mbk
formatting C++ Calendar Program
 
Need help! I'm trying to figure out how to print the first day in the right day of the month #include <iostream> #include <fstream> #include <iomanip> u...
[2 replies] Last: yeah but I've tried everything but I don't how to put the first day on... (by Mbk)
Sprintf only sending last message.
 
I have two programs, one is a server and one is a client. It is a game of jackblack that is played on the client. In one of my functions DisplayCards(); void...
[1 reply] : Bump (by Westonrwright)
pseudo-code
 
Having trouble reading this simple pseudo code to insert into a function. The topic of this code is inserting into an array based list. Insertion Given-the ...
[3 replies] Last: You've never followed cookbook instructions before? You've never even ... (by LB)
Parking Deck Simulator
 
Hey guys! Below is a program that I coded that is meant to simulate a parking meter within a parking deck. The program has no bugs, but the outputs are coming o...
[5 replies] Last: Yes change it to int. Also, I dont quite understand the if statement i... (by TarikNeaj)
Need a little help with class
 
Here is a single step for part of my homework. equaltdate is a function I have to implement into my class. 6. equalDate the dates of two Appointment objects, r ...
[1 reply] : 1) Your getName() function returns an int instead of a string. 2) your... (by Texan40)
c++ calendar
 
I am having trouble coming up with source code for this :( Speci fications: 1. Calendar is menu-driven. The user chooses his desired activities by selecting o...
[1 reply] : Please do not double post - http://www.cplusplus.com/forum/beginner/16... (by TarikNeaj)
help with structure
 
Hi everyone! I don't know how to do that. I have a task to do for school This is structure: structure competitor { int password; string l...
[1 reply] : http://www.cplusplus.com/doc/tutorial/structures/ https://www.youtube... (by TarikNeaj)
by Dkob1
How to make straight?
 
Ages are not straight, how to fix? #include <iostream> #include <string> #include <iomanip> using namespace std; class SIX { private: struct PE...
[10 replies] Last: Oh I didn't knew that... Thanxx @ keskiverto . PS: I a a newbie and I ... (by shadder)
Why is my program writing to the same line in .dat file
 
I am creating a library Management system. The system is meant write and read from a .dat file. However the system is having problem writing the user input into...
[1 reply] : However the system is having problem writing the user input into the ... (by coder777)
Best way to provide access to objects in multiple layers of parent classes.
 
Ok, this may not be the best title but let me explain what I mean: I have multiple classes, something like this: class GameState { private: Graphics& _gfx...
[4 replies] Last: But how would the player class add its sprite to the GameStates render... (by Horscht)
traffic light
 
Im Getting a but load of errors I have to make a traffic light. Im thinking I have things mixed around or something. any help is appreciated. I know basically I...
[3 replies] Last: I see the draw rect as a private function of the TrafficLight class; i... (by LaboPie)
by Matep
Algorithm Complexity problem
 
The task is to find the shortest way from me ('S') to the hut('D') without touching the flood ('*') or the rock ('X'), for each step I take, the flood spreads i...
[1 reply] : Breadth first search A star Dijkstra These are all names of algorithm... (by Smac89)
Sorting 2D Arrays
 
Sorry Im new in this forum. I have an assignment due tonight that I have display student ID's and grades for those ID's. The problem I am having is that when I ...
[1 reply] : Don't make unnecessary function arguments. I would put all the code i... (by poteto)
is this code valid ?
 
#include<iostream> using namespace std; int readHours() { int sumhours=0; while(hours!=-99) sumhours+=hours; return sumhours; } int main() { int hours; cout<<"E...
[1 reply] : at a glance it looks like you will be in an infinite loop if you call ... (by Westonrwright)
April 2015 Pages: 1... 1819202122... 28
  Archived months: [mar2015] [may2015]

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