General C++ Programming - October 2015 (Page 2)

Not sure why this isn't working.
 
For whatever reason, I had to declare int I before the for loop due to some error code, however when I try to run this, I am only getting the first numbers swit...
[4 replies] Last: Like I said, you need a second loop to print the arrays, or you need t... (by dhayden)
'Segmentation Fault'
 
Hello, I was just wondering why I keep getting a segmentation fault when I run my program. What this function does is collect text from the text file and stores...
[4 replies] Last: Hi, My 1 cent worth :+) Don't loop on eof Instead, loop on the fi... (by TheIdeasMan)
Constructor and vector<vector<int>>
 
Hello, I need help with creating a constructor. It seems to be an easy task but I could not find the proper initialization that could be run by my compiler. ...
[1 reply] : My problem is to implement the constructor such that 'neighbors and w... (by TheIdeasMan)
Can't get extern to work with istream or ostream in Linux
 
I just don't get it! I completed my program for school, was ready to turn it in before midnight. Then I tried compiling it on Linux. I can't use extern for i...
[3 replies] Last: where the standard C++ library implementation is broken in more place... (by closed account 48T7M4Gy)
Void function help
 
void solved
[2 replies] Last: http://www.cplusplus.com/doc/tutorial/functions/ (by integralfx)
Need help!
 
Hi everyone! can anyone helps me on this lab on c++ programming. 1. You are to write a function int readDouble (double x ) which will read (at most 50 ) doub...
[1 reply] : All your problems are solved at http://www.cplusplus.com/forum/genera... (by closed account 48T7M4Gy)
mathematical refrencess in visaul form application
 
Hey guys, so today i came across this little problem. How do i use square roots, sin, cos, tg and so on, in C++ visual form application... I cant find it anywhe...
[5 replies] Last: Now its working. The ol' ints vs doubles trick! (by closed account 48T7M4Gy)
by isanh
Minor Problem with Code
 
I created a program based off this Project Euler problem. https://projecteuler.net/problem=4 I managed to get my program to work, however it doesn't work the w...
[2 replies] Last: http://www.cplusplus.com/forum/general/177482/#msg875307 (by closed account 48T7M4Gy)
by isanh
Problem not found
 
I created a program based off this Project Euler problem. https://projecteuler.net/problem=4 I managed to get my program to work, however it doesn't work the w...
[2 replies] Last: http://www.cplusplus.com/forum/general/177483/ (by closed account 48T7M4Gy)
Need help to start Vector Program
 
Here is what we were assigned. I have no idea how to start this program. Any help would be great. Here is the assignment: Write a program that implements th...
[1 reply] : Write a program that implements the Vector code written in class as a... (by kbw)
level of binary tree
 
Hello, I tried to do find the max value at certain level of the binary tree (say the third level), but I have no idea how to do it. I try to implement counter ...
[3 replies] Last: You also forgot to format your code. It kinda hard to talk about it wh... (by kbw)
Display max value in array plus corresponding subscript.
 
Hello. First year programming student, here. I have a hw assignment to store monthly rainfall into an array and then find max and min and display the month that...
[1 reply] : Please edit your post and add code tags. That will make it much easie... (by doug4)
Dynamic declaration of vectors
 
I know there is no simple way of declaring variables dynamically in C++ but I'm looking for possible ways of passing in a vector to a function and somehow have ...
[6 replies] Last: That's another way to see it.. hehe (by closed account 1yvU5Di1)
by guru23
Trouble grasping arguments passed by reference
 
Hello, I can't figure out why the output of this program is 0. How does the "&" sign cause this to happen? What exactly does it mean to pass arguments by r...
[2 replies] Last: Hi, Passing by reference is handy because the value of the variable i... (by TheIdeasMan)
Seg Fault for Complex Number Overloading Operator
 
I am trying to make a Complex Number class and I can't seem to figure out why I get a seg fault whenever I try to display the number when real and imaginary are...
[3 replies] Last: you promised to return an ostream& , but you didn't. (by ne555)
Creating object within object
 
So I have a header file which consists of a class called "Date" which is a class that stores attributes for dates such as, day, month, year, checks if its a lea...
[9 replies] Last: I do not have enough information to work it out, unfortunately. If you... (by TwilightSpectre)
by Ozzy69
Need help (File) C++
 
Hello, i make a code in c++ for read files. This code read of last line until first line, but i want know if have how improve this code. My file: Sum: 3 4 5 6 =...
[3 replies] Last: But i can't use vector! Does that mean you are not permitted or yo... (by closed account 48T7M4Gy)
by Dkob1
Array expression
 
How does an array variable indexing expression differ from an array definition size expression? Is it: array index only for index and array def'n specifies jus...
[2 replies] Last: Hi, An ordinary array must have it's size be a constant and known at... (by TheIdeasMan)
help me
 
#include <iostream> using namespace std; const int MAX_SIZE = 10 ; enum HealthType { POOR, FAIR, GOOD, EXCELLENT }; struct AnimalType { long id;...
[2 replies] Last: http://stackoverflow.com/questions/10371681/enum-type-can-not-accept-c... (by ats15)
these strings won't stack!
 
I'm learning to use the stl containers, iterators and algorithms. There is one line of this exercise which isn't working and I cannot understand why. In the...
[2 replies] Last: Thanks! That worked like a charm. There were a bunch of other proble... (by kalistibot)
October 2015 Pages: 1234... 27
  Archived months: [sep2015] [nov2015]

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