General C++ Programming - October 2016 (Page 16)

Splitting an Input String With substr Only
 
I got myself a C++ book because i start uni in a few months for computer pogramming, so i fogured I'd expose myself to it. There's a problem in my book that ask...
[1 reply] : This should help http://www.cplusplus.com/reference/string/string/era... (by SamuelAdams)
Help with C++
 
My goal for this program is to have it allow a user to enter any amount of numbers up to 12 until a sentinel value is entered and display them in reverse order....
[1 reply] : What I have is not correct and is returning errors. Can you be more ... (by MikeyBoy)
Define array of n variables
 
int fn(int n) { const int z = n; int a , i; i = 2; for (int j = 0; j <= n - 1; j++) a = 1; do { a = a[i-1] + a[i-2]; i++; } while (i < ...
[5 replies] Last: Thanks, the function now works perfectly using vectors. #include <ve... (by rogeruab)
by Faz777
Random Access Empty STL List
 
I wanna have random access to a position n in an empty STL list. If the list was not empty, I would easily access it by using advance or just using a loop to in...
[7 replies] Last: @Duoas You can actually insert() in an empty list: mylist.insert (my... (by coder777)
by Faz777
Algorithm
 
Running Time.
[3 replies] Last: Please don't delete your question after you've received an answer. It... (by MikeyBoy)
by om4r97
Fstream and store data in arrays
 
Hello everyone i'm new C++ lover :) how i can store specific data type from text file in multiple arrays for each type ?? like string array fore firs...
[3 replies] Last: You should remove the getline (line 28), otherwise you skip lines, and... (by fcantoro)
Input/Output file problem
 
"John Doe wants to earn more money by investing in the stock market. In order to play it safe, he employs the diversity investment plan; investing in different...
[4 replies] Last: Are you sure? When I compiled and ran your program it quite happily ou... (by commandline)
Inputing Days to get months
 
I am having trouble on compiling this which ask for user to input an integer between 1 and 365, and it output the month and day that the integer fall under. I ...
[1 reply] : I presume the seg fault is either from the use of the variable month i... (by commandline)
Help with dynamic array in a class
 
Heres what im having trouble doing. Modify your function to add a given element to the array at the next available location by including the following featur...
[2 replies] Last: In your ADD(...) function: Remove the parameter count3 (and probably... (by coder777)
expected initializer before ‘int’
 
prog3.cpp:10:1: error: expected initializer before ‘int’ int main () ^ this is what i get when i run this program please any help regarding this it wil...
[8 replies] Last: @mbozzi thank you for the help its so much appreciated and helpful f... (by jackmartin)
How To Initialize Array Of Ints As String Literal
 
I am attempting to initialize an array of ints as a string literal. So far, this is what I have. #include <iostream> union { char Chars ; unsigned int int...
[3 replies] Last: Thank you so incredibly much for your input. You really are incredibly... (by da peppester)
What am i doing wrong? It will Display the correct answers but does nOt give the students?
 
I am supposed to Write a program helps your instructor grade quizzes. The program will read a file containing a single student’s answers to a recently given q...
[no replies]
by koopey
creating general b tree. can't find the damn bug!
 
I can't find the error no matter how hard I try. Error starts if no of input >=4. know shouldn't post entire code but don't know where is the error. so... ...
[3 replies] Last: In your function void overflow(btptr T,btptr &root) called from ins... (by mbozzi)
Point class and variadic template
 
Hi, I am trying to implement a simple Point class using variadic templates as discussed here . My goal is to have this output possible: Point<int, 3...
[2 replies] Last: Thanks Arslan7041 ! (by BobMorane)
Functions within external files
 
Hello everyone, I have a question. I am receiving a scope declaration error when trying to use 2 functions from within an external file. Function 1 calls funct...
[2 replies] Last: I have solved the issue. Deleted both .h and .cpp Created new .h and ... (by deviousd)
C++ Program Help
 
Create a program that allows the user to enter the gender (either F or M) and GPA (0.0 through 4.0) for any number of students. The program should calculate and...
[no replies]
Error in C++ Program Help Please
 
Any Suggestions For why this won't debug properly. //displays the weekly gross pay for any employee #include <iostream> using namespace std; int main(...
[4 replies] Last: Thank You! (by tennisnash2)
Rotate Rubik's Cube array;
 
Hi all. I'm writing a Rubik's cube program, and would to know of any simple way to rotate the top or bottom of the cube. I have the straight rows and columns ro...
[11 replies] Last: I don't need to see it. If you have it figured out, that's all you ne... (by doug4)
Expected unqualified id
 
I'm currently in the baby stages of a program, which is supposed to call from separate files and get their information in order to work. I have been getting thi...
[2 replies] Last: Declare a class (BookType) type like this: BookType b and not class... (by crosslink)
Not sure whats wrong with my program.
 
5.17 (Multiples) Write a function isMultiple that determines for a pair of integers whether the second integer is a multiple of the first. The function shoul...
[2 replies] Last: Your code is almost correct. But a few important details have been lef... (by crosslink)
October 2016 Pages: 1... 1415161718... 23
  Archived months: [sep2016] [nov2016]

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