General C++ Programming - May 2017 (Page 12)

by Alex A
passsing array and validating
 
Hi guys, can someone help me out on solving this problem below? I'm stuck on how to set up the while loop to exit when the user enters zero for months. I also ...
[no replies]
Program Assignment Help
 
I know people do not usually put questions like this on me but please help me with this program! I am a beginner and am really stuck! :) For this pr...
[1 reply] : http://www.cplusplus.com/forum/beginner/129857/ (by gunnerfunner)
by Svenge
Stuck displaying multiple class objects
 
---Magazine class definition with the broken display function--- class magazine{ friend class Date; friend class Person; private: person subscriber; ...
[1 reply] : double post - please delete this thread and let's concentrate on this ... (by gunnerfunner)
2D Array
 
Hey guys! I am working on arrays and I pretty much almost done if I can only solve the problem with my code, it builds but crashes when the user enter a number ...
[3 replies] Last: Whoops! thanks jonnin for pointing that out!. Now it runs but I am sti... (by RevvedUp)
Function/Array Question
 
Part 1 "Write a function that would take an array of strings, and sort it so that the strings appear in alphabetical order" We don't know how big the arra...
[1 reply] : In normal, everyday C++, arrays whose size we don't know are called ve... (by Cubbi)
by tayyeb
help with coffee shop program?
 
Hi all, I have to create a coffee shop program where you can: • Buy coffee in any size and in any number of cups. • At any time show the total numbe...
[no replies]
Template class files
 
Hello everyone, I'm trying to write a template class but I didn't understand how .h and .cpp files are to be managed. Where should the implementations and dec...
[2 replies] Last: Thank you for the very fast reply! (by s222571)
by Kalcor
Pointers
 
char a = "ABC"; char *p = a; print(++*p); print(*p++); print(*p); tbh i got tired from understanding this, they all will print B i d...
[5 replies] Last: On the other hand, I got them when I used cout in this form: In the... (by cire)
by Kalcor
Printf
 
Hello I've got this code: char a = "ABC"; printf("%c", a); It prints some weird char but when I use printf("%s", a); It prints the char array norma...
[5 replies] Last: so change it to printf("%c", a ); //or any other desired location. ... (by jonnin)
Classic N Queensm problem
 
i had this code written out long time ago and up til now i cant figure out what is wrong with it .. i even tried debugging and im still clueless. the problem...
[5 replies] Last: Last Chance is my only and last hope <3 thanks a tone <3 <3 .. (by zeroblank)
Huge matrix that adds and deletes rows dynamically
 
I'm trying to simulate the mean behaviour of an ensemble of neurons. This means I need to do calculations with a matrix of a couple of billions of elements (ste...
[10 replies] Last: Why do you need arrays at all, multi-dimensional or otherwise? Hones... (by aldomann)
Using multithreads for simple computation
 
Hi everyone. I am trying to understand how to use threads to compute simple operations faster. I am just having difficulty understanding the relation between us...
[8 replies] Last: thanks for your patience but I think I'm done for this round unless ..... (by gunnerfunner)
Allocator Usage with STL Unordered Set
 
I have a set that will contain at most 25000 elements. Now if I use the std::unordered_set, every time I insert a new element (which is of type MyStruct), mallo...
[5 replies] Last: Thank you! (by JLBorges)
by ceeely
Speed up For Loop with.pushback
 
I'm trying to speed up the following codes: for(int curRow=0; curRow<numRows; ++curRow){ // long loop int lb = csr_rowIndices ; int ub = csr_rowIndices[...
[18 replies] Last: you can schedule or split it this way, sure, all you have to have is f... (by jonnin)
Age Calculator- Where am I going wrong?
 
I can't seem to get a grasp on things lately so I apologise for the multitude of posts. My task is to create a program which will display the prefilled birthda...
[2 replies] Last: That got it working (as well as it can do at the moment)- thanks so mu... (by Airynoob72)
2D Array Problem
 
Hi I have tried this below code #include<iostream> using namespace std; int main() { int m,n; cout<<"Enter the size of array "; cin>>m>>n...
[1 reply] : Please don't start multiple threads on the same topic (or subtly chang... (by lastchance)
Dice Game: Logic and Classes
 
So, I have been working on this homework assignment on and off now trying to figure out how to properly structure it so that it works. Unfortunately, I am havin...
[2 replies] Last: Thanks! I figured it out and trimmed it down a bit! (by stiteywhitey)
Theater Management
 
So i'm currently in an introductory C++ class. Most of the assignment have been relatively simple and I've been able to figure them out on my own except the las...
[6 replies] Last: I don't have any code yet since I have no idea where to even start. ... (by TheIdeasMan)
Use of smart pointers vs new and delete
 
I hear all the time from experts that it is preferable to use smart pointers; one should never need to use new/delete in application code. However I have run...
[7 replies] Last: @JLBorges Splendid, thank you :+) (by TheIdeasMan)
Trying to store data from file into arrays
 
#include <iostream> #include <fstream> using namespace std; int main() { const int ARRAY_SIZE = 1000; // Array size double accountNumbers...
[2 replies] Last: Thank you and thank you! (by chris213)
May 2017 Pages: 1... 1011121314
  Archived months: [apr2017] [jun2017]

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