Beginners - November 2016 (Page 7)

Writing a dynamically allocated struc to a txt file
 
The problem i'm having is getting it to save in a regular readable way. All that is ever outputted is garbage non character data. #include <iostream> #...
[2 replies] Last: ok thats great. now how do I format the out put? im doing accord << ho... (by melmar3)
MessageBox error
 
What do I need to do to get "message" in the messagebox without any weird characters. #include <iostream> #include <windows.h> using namespace std; ...
[2 replies] Last: Great ! Thanks man your a hero. (by Day Vide)
Passing Arrays of Objects to Functions
 
I have an array of objects and I am using this array in 3 separate function calls: totalJars, highest, and lowest. Everything compiles without error, but I am...
[2 replies] Last: Thanks so much!! (by gr8flmommy)
Binary Search not working
 
whatever number I type in it always goes to element 0 and it always says the number is valid. Been messing around with this and reading the code for a couple ho...
[3 replies] Last: ugh, wow. such a simple mistake. thank you cire. and all the weird "re... (by SkarFaceT9)
Split String to Validate
 
I need a help to validate a string. The string is a day with date, month and year. For example, Sunday, November 2016. So I need to split them to check the da...
[2 replies] Last: Someone reply and help please.... People will come and help when and... (by integralfx)
C++ Structures program
 
Hi all, for this program it has to display the stored information in the array and the information the user enters into the getInfo function. This is what I hav...
[2 replies] Last: Lol dammit, thanks for the catch! So I fixed that but this is the outp... (by Miraclefruit)
template confusion
 
I would like to apply the same type to a friend operator>> function. Not sure how though, and the following compile appears: c++ -g -std=c++14 -pedantic ...
[4 replies] Last: Finally solved, so I thought I'd post solution for any comments. ... (by bluefrog)
by coll97
Erase from string
 
I just need to get the second word of a string, for example if the string is: string comanda = "Hello world" And I only want "world", all I have to do is:...
[3 replies] Last: Not relevant, you have a misconception about what std::string::find_... (by integralfx)
by coll97
Sum calculation (string)
 
They ask me a function that has to make this, example: //Input: (+ 10 5) //Output: 15 //Input: (+ (+ 2 3) (+ 3 1)) //Output: 9 I have think of two func...
[1 reply] : You might want to have a look at this: http://www.cplusplus.com/forum/... (by integralfx)
Hangman theme/words
 
Hello I am trying to make a hangman game where I ask the user to choose between a set of themes and then randomly select a word for the user to solve. However I...
[2 replies] Last: thank you so much ! (by jonnieb12)
What Is The Point Of A Constructor?
 
So I recently started to study about structures and came across constructors and destructors. Can somebody explain to me what the point of them are? Any small ...
[1 reply] : Constructors are called everytime you make an instance of a class. (in... (by Golden Lizard)
C++ working with .txt file
 
Hello everyone, I'm having problems working with .txt files in C++.. In the C++ main function the name of an input .txt file shall be inputted, the name of an ...
[14 replies] Last: I can now:D (by oanaa94)
IF statements inside FOR loop
 
I'm trying to write a program that reads in a users input and iterates through it and finds a certain word. If that word is found, do something. Quite simple ac...
[4 replies] Last: Because you wrote the same for loop and your string value is the sam... (by fantomasAlbania)
continuous loop
 
tell me where the error ?? It is necessary to cause the R-Y-G-Y-R, etc. void Traffic_Light::processing() { do { switch (current_color...
[2 replies] Last: What type of varibles are the colors ? I think you should declare them... (by fantomasAlbania)
function: is string a substring - Help Please
 
Question:: function to check whether string s1 is a substring s2. The function returns the first index in s2 if there is a match. Otherwise returns -1. Uses...
[3 replies] Last: Please do yourself a huge favor and include <string>, not <cstring>. W... (by xismn)
issues with functions
 
I cant figure out how to make the if statements into functions such as if (move == 'u') { grid = ' '; y--; if (grid == '#') { ...
[1 reply] : Some can be easily made into boolean functions bool is_Trap(const ch... (by Golden Lizard)
by Coyo
Help with outputting the max and min number using If Else
 
Hi there new to the forum and new to c++ and programming (been doing it for 2 days) Anyway I am trying to self learn using a book and an online course and i'm ...
[7 replies] Last: Thanks for all the help guys, problem solved. really appreciate the re... (by Coyo)
Do while loop issue
 
For reference, here is my project statement: You're working for a lumber company, and your employer would like a program that calculates the cost of lumber f...
[7 replies] Last: With the do while loop, the error message gets spit out even if a vali... (by wildblue)
credit card validation
 
My errors are: note: No constructor could take the source type, or constructor overload resolution was ambiguous : error C2664: 'int sumOfOddPlace(cons...
[2 replies] Last: Thankyou!! It works perfectly! (by rdigney)
Pop Push Algoritms
 
xxxx
[2 replies] Last: if it was a homework i can get it from my friend i am trying to learn ... (by Favorii)
November 2016 Pages: 1... 56789... 44
  Archived months: [oct2016] [dec2016]

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