Beginners - February 2016 (Page 38)

by Dien09
User input in C++
 
Hi, I am new to C++, and I was wondering if anyone could please help me with user input. I need for the program to end when the user types "quit". I am not sure...
[9 replies] Last: Oh, that's easy to implement, with just a few little changes to my ori... (by naaissus)
by noodel
while beginner
 
Hey, how should I make this program to count how many even numbers are in given number. For ex., if you are given 15623, the answer should be 2. #includ...
[7 replies] Last: Ah yes, you mustn't recalculate n inside the if statement, because thi... (by Courecity72)
What would a return type be?
 
Write your question here. Hello I have just started coding in c++, I have a question regarding returning datatypes. Suppose you have input 4 variables of the...
[4 replies] Last: So in this case it should be a double then. I.e to be on the safer si... (by TarikNeaj)
assign letters to numbers
 
Say I have a vector of char that contains the letters: 'happy' I want to assign a number to each one of these characters, but, those numbers should only be fro...
[2 replies] Last: Ok let's say I want to use maps. Also, I want the user to input the s... (by DeathLeap)
I'm trying the if and else statement but it's not working
 
so I've been trying the if and else statement and I've tried to do a basic console program with it but it isn't working and I can't understand why. #includ...
[4 replies] Last: Better yet, don't have using namespace std; at all. Google to see wh... (by TheIdeasMan)
by the q
Code breaks when randomly specifying matrix values
 
I'm trying to code an LU decomposition solver. My code actually seems to work fairly well when I specify a vector of vectors manually. However when I comment o...
[no replies]
Writing a program for mechatronics
 
So it's for our finals and I need to make a system for mechatronics. I have no idea what to do. This is something new for me. I just have these questions. I...
[no replies]
Visualizing the code for sorting
 
We are reviewing structured programming and will soon reach sorting. My question is, what should I think about to better visualize the approach and writing of s...
[1 reply] : This guy explains it well both visually and in code - https://www.yout... (by TarikNeaj)
Key Letter and return as char
 
I am very new to this and working on a project that requires me to use char getKeyLetter as an input method, but the instructions also state that it won't be po...
[5 replies] Last: Ok, so I have gotten my phrase as well as my letter and returned them,... (by Jester87)
C++ not reading number values from text file
 
Part of my homework deals with reading floating-point values from a text file, and then outputting them. As such, I have two "float" variables into which data f...
[15 replies] Last: > when I should have written this: > E:\\CIS 022\\Lab 2\\Files\\stude... (by JLBorges)
Writing object into binary file
 
I have a linked list object, which I want to write the contents of into a binary file. The way I learned how to write into binary file is using this method: ...
[10 replies] Last: Even I had the same problem ,the best and efficient way I came up with... (by mbsaicharan)
matrix multiplication
 
Hi, I'm trying to write what seems like ought to be a fairly straightforward program but it doesn't seem to be giving the right answers. The program is suppo...
[1 reply] : The problem is in line 97 where the second "column1" should be "column... (by bool maybe)
Problem creating an output file
 
So I'm trying to make this program create an output file instead of displaying it on the console. Everything compiles fine, but it still displays the output and...
[1 reply] : You have to declare your out_stream variable before you open the file.... (by pnoid)
by MrPain
Class with function parameter problem
 
So it could be problem with implementation or with my logic in general. Code is pretty short and it can not compile. "Operation" takes one function as 3 paramet...
[1 reply] : Pointer to member function: http://www.informit.com/guides/content.asp... (by JLBorges)
Input Loop Exit Condition?
 
Hi, I'm working on a function here and I'm trying to make the loop end if a '.' is ever entered. But I need it to process input up until the '.' and ignore anyt...
[3 replies] Last: Thanks Duoas! Using this now: void getInput(char input ) { cout << ... (by exelbeast)
by Ansev
Vector elements into contiguous memory
 
G'day Is there a way to move the elements from a vector <bitset<6> > into contiguous memory while retaining their binary format? #include <iostream> #include...
[5 replies] Last: > I know that this is a complicated program to try for a person who ha... (by JLBorges)
Cannot open file
 
I am writing code to calculate GCD. I use Visual Studio 2015 When I try to rebuild solution, it says it cannot open the program file. Is it a problem with the c...
[4 replies] Last: Oh right, I actually never looked in the file before, thats why. (by RUNNER PRO AGARIO)
by kmce
c++ player me / me.name
 
Hello. I am learning c++ from the "learning c++ by creating games in UE4" book and there is a section i am stuck on. I have copied the code from the book, it is...
[10 replies] Last: Me, no I got another book after, also still on UE4, but it taught me.... (by RUNNER PRO AGARIO)
Need help in writing this program
 
Two employees at a particular company have received a pay increase of $10,000 on their annual salaries, which is retroactive for six months! Write a complete C...
[2 replies] Last: You should know not to give us your homework, Give it a try of your ow... (by RUNNER PRO AGARIO)
formula problem
 
Hey guys,so my program is supposed to calculate a mortgage monthly payment, also figure out the total amount paid. My problem is in the total payment is cutting...
[6 replies] Last: Thank you you were right, using; cout.precision(2); cout << fixed <... (by b29hockey)
February 2016 Pages: 1... 3637383940... 46
  Archived months: [jan2016] [mar2016]

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