General C++ Programming - April 2016 (Page 12)

by NRob
Passing Objects from one Class to another
 
Hi, I'm newish to C++ (9 weeks). For a project I've been tasked a phone book, using individual classes. class Contacts {//contains the data i.e num and name...
[8 replies] Last: I've made lots of progress today. Ive figurered out how to pass objec... (by NRob)
Vector iterator not incrementable?
 
Hi all, I'm getting this error: "Expression: vector iterator not incrementable" at run time with the following code: bool Digraph::removeVertex(const strin...
[4 replies] Last: auto it = container.begin(); while ( it != container.end() ) { ... (by cire)
by krisp1
Calculate Students GPA for the Semester
 
Write a C++ program to calculate a students GPA for the semester. The program should accept a student’s name, ID number and the number of courses he/she is ta...
[3 replies] Last: so where do i execute do-while loop? and how to make the condtion in w... (by krisp1)
vector,binary search,bubble sort and insertion sort
 
i wrote most of the code but every time i run it and press 1 or 2 the program just crashes i don't know why In C++ Using the vector type as your list, imp...
[2 replies] Last: first is to read the output and the second is to select the option sho... (by playersonly31)
Writing FTP Client
 
Hi everyone, I have some problems with writing FTP Client. This is the first time I use socket, inet... Please help me to know what functions and how they work...
[3 replies] Last: You can download it here: http://pocoproject.org/download/index.html (by Thomas1965)
Circular right shift
 
Dear everyone, I need to do a circular right shift to get 4552 from 5524 or 22266 from 22662 or 82719 from 27198. How it is possible to obtain such shift? I...
[9 replies] Last: A different algorithm to rotate right by one (reverse the first n-1 d... (by JLBorges)
Help with function arrays
 
Hi, I'm learning about functions and arrays. I'm trying to use for loop to assign values to the array but it isnt working... this is the code: #include <ios...
[3 replies] Last: You did not initialized your area a therefore it has any random numb... (by closed account 48bpfSEw)
Help with initializing vectors
 
I understand that in earlier versions of C++ that you cannot initialize vectors in this fashion: std::vector<int> vec = { 1, 2, 3 }; It is also to my unders...
[3 replies] Last: The http://cpp.sh gives same error both with and without = in C++98 mo... (by keskiverto)
can not declare ac variable to be abstract type 'Account'
 
class User { protected: char password ; char username ; string type; int deposit; public: virtual void mainmenu()=0; }; class Cus...
[1 reply] : You have to implement the function Account::mainmenu() . (by Moschops)
Redo a statement when false ?
 
I'm very new to programming in general and so do not know much... I made this code in my spare time: #include <string> using namespace std; int main(){ ...
[3 replies] Last: oh alright Thanks for the help (by NoobPr0grammer)
Passing 2d array to header
 
I'm having some trouble passing a 2d array from my .cpp file to a header file My function in my .cpp file looks like void Lab::logoff(int (&arr) ) an...
[1 reply] : void Lab::logoff(int (&arr) ) int logoff(int (&) ) cons... (by integralfx)
Converting iterative to recursive function
 
I have to write a recursive function called void recursive_call(int call) based off an iterative function, that I need to convert to a recursive function that ...
[17 replies] Last: void zig_zag( unsigned int n = 0 ) { if( n < 4 ) { st... (by JLBorges)
splitting a string in fstream
 
basically i just need help with an algorithm this is just a snippet of my code i need to split a entire line of data. Assuming that this line is just a bunch of...
[3 replies] Last: > What does sb stand for? sb is the input string stream. std::istr... (by JLBorges)
Programming Help
 
Hey all I am new here so sorry if this is a spaghetti post but this is the only place that I could turn with an assignment due in such a short amount of time. ...
[no replies]
Help with a program
 
I am in need of help with this program. I am not very good. Project 3: The Isle Royale Wolves and Moose Please note that this project indicates precis...
[no replies]
How to find the local MINs and local MAXs of graphs with "noise"?
 
I'm currently working on a project and I'm running into two issues that I can't seem to solve. They revolve around finding the local MINs and local MAXs of a da...
[4 replies] Last: That will definitely lessen the effects of the noise, and give me a m... (by Pat0010)
Array Perimeter for Template with Array Library Function
 
Hi, I am learning how to use template for the first time so that this question might seem stupid for some of you. Please bear with me because I can't find the s...
[5 replies] Last: cire and JLBorges, thank you. I am going to learn more about the templ... (by penguinlay)
Happy number question
 
I have to write a program to compute a happy number. A number is called a happy number, if you repeat the process, of squaring the sum of the digits, till the v...
[3 replies] Last: Thank you for the help again. I managed to solve it. simply needed the... (by aurimas13)
Reading data from text file in VC++ 2010
 
FILE *gdata; gdata=fopen("a1.txt","r"); for( n=1;n<=50;n++) fscanf(gdata,"%f %f %f\n",&x1 ,&y1 ,&z1 ); fclose(gdata); for( n=1;n<=50;n++) //print...
[2 replies] Last: Here is a simple sample: #include <stdio.h> #include <stdlib.h> con... (by Thomas1965)
Ignore the following:
 
Using this is a template to study from. I just want one area where my code is printed neatly. (Please do not delete, Admins) Thank you! #include <iostream...
[5 replies] Last: #include <iostream> using namespace std; class Color { public: Col... (by Terribad13)
April 2016 Pages: 1... 1011121314... 23
  Archived months: [mar2016] [may2016]

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