Beginners - July 2015 (Page 15)

Alphabetical Order Using a Vector
 
I was attempting to build a program that would read a string of words that were entered using a vector and put them in alphabetical order without repeating any ...
[1 reply] : Do you see where your while loop ends? Hint it is not on line 14 I kn... (by kevinkjt2000)
by stav
linked lists
 
hi i'm trying to build a linked list but i've run in to a problem... for some reason i can't print it out? it compiles just fine with no errors but when i run i...
[2 replies] Last: This seems to be a simple example of a linked list using a class descr... (by CodeWriter)
Why are my Char * values not equal, if I'm giving them the same value?
 
These two values are set to the exact same thing basically, but for some reason, crate != "0 HEAD". char crate = "0 HEAD"; if (crate == "0 HEAD") ...
[3 replies] Last: OK. That was super helpful. Thanks guys! (by keanedawg)
What is this program doing?
 
What is this program doing? #include <iostream> using namespace std; int main() { cout<<"This program computes the average of "; cout<<"a list of (...
[2 replies] Last: if i enter a negative number it averages out only the non negative num... (by gregorydouglas89)
need help with a program
 
Okay, so I have an assignment, and I have been breaking my head for days can't figure it out. The idea is to creat a program that reads numbers from a file, ...
[4 replies] Last: Thanks a lot! (by AlphaAce)
key calculations are not happening...
 
Running into a little trouble with this one. The comments on the code pretty much explain what the program is supposed to do. I'm just brain farting on it. I go...
[2 replies] Last: this did the trick....code updated above. Thanks Mike (by ironsoldier71)
Running mean and variance
 
Almost done with my dice roll simulator which simulates a roll given a XdY user input. There's only two problems: that my mean and standard deviation are all o...
[2 replies] Last: Awesome, thank you. Totally obvious now that I think about it. I also... (by brachburton1)
initialize the smart pointer to nullptr by default
 
Hello, I have the declared the vector of shared pointer as a member of the class. Is it necessary to initialize the pointers to nullptr inside the construct...
[1 reply] : smart_ptr will be nullptr by default. (by coder777)
by suppa
Diagonal Lines problem!
 
I have been working on this for 2 days now and cant seem to get it right. So any help would be greatly appreciated. For this problem i should be able to input a...
[11 replies] Last: #include <string> #include <iostream> int main() { int L = 0, R ... (by closed account 48T7M4Gy)
Design Using a For-Loop
 
Input the number than make an X in the following way, for instance, when you input a 5 you output 5 1 4 2 3 4 2 5 1 when you input a 7 you ou...
[1 reply] : First make sure that the user entered an odd number -> (X % 2) != 0 ... (by coder777)
Cin holding passing info into next cin
 
I've noticed that although my code "works" if you follow the rules, adding more numbers causes this value to be passed to the next cin. for example in this pro...
[8 replies] Last: That is considerate, but funny thing is your code still has the proble... (by Digitalwolves)
Question with constructor initialization
 
When I initialize my constructor like this : Person::Person(std::string newName, int newAge): name(name), age(age) {} And have.. std::string ...
[1 reply] : I already answered this question here: http://www.cplusplus.com/forum... (by Disch)
Weird output in dice roll simulatr (XdY)
 
So I'm writing a program that simulates a dice roll based on an input given by the user in XdY format where X = the number of dice to be rolled and Y = the numb...
[3 replies] Last: Protip: Use a debugger. Set a breakpoint and step through each line ... (by Disch)
problems with arrays
 
What I thought this was going to do was put numbers in lineArray and rowArray. lineArray would be 1 and lineArray would be 2 etc. that's not the output I'm g...
[18 replies] Last: ASCII characters are integers. That is why you are getting blanks and ... (by closed account 48T7M4Gy)
how to smoothing filter
 
Write your question here. I have a program that gives a distance reading ok. However it jumps around a lot so I need to make a smoothing filter. The print line...
[9 replies] Last: I think you will like to play with he Arduino stuff. Adafruit is a rea... (by DontheOne)
by suppa
Displaying Diagonal Lines that intersect using for-loops (1,2)
 
Hello, in my assignment i need to 1)Input the number than make an X in the following way,for instance, when you input a 5 you output- -5---1 --4- 2 ---3 --4-2 ...
[32 replies] Last: This is still extremely hard, i am trying to modify it to where it dis... (by suppa)
Help with Turbo c++
 
So this is a beginners question. I don't know much about compilers so correct me if I'm wrong. I'm in (equivalent) of grade 11. In school, the computers have Tu...
[4 replies] Last: CodeWriter, Surely you have been provided with some similiar text boo... (by ephraimr)
recursion advice
 
Hello, this was my problem to figure out... write a function that takes an array and displays the elements in the array in reverse using recursion and not a l...
[1 reply] : Why does fillArray have a hard coded 10 in that loop? It should use t... (by kbw)
by nofish
overloading operator>> ()
 
In this book I'm learning C++ there's an example of a String class with an overloaded operator>>() via friend function. #include <iostream> #include <string...
[4 replies] Last: Erm, nope. As kevinkjt2000 said, your GetString() returns a const c... (by nofish)
by eons93
I'm back from slaying errors and only 23 deadly errors remain. (1,2)
 
day 3 of my error clean up :D I want to thank you everyone in advance and in the past that has helped me. Main.cpp #include <iostream> #include <ctime>...
[24 replies] Last: haha, thanks, I've ran into a new problem now though. I'm trying to ha... (by eons93)
July 2015 Pages: 1... 1314151617... 33
  Archived months: [jun2015] [aug2015]

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