Beginners - March 2018 (Page 11)

Why wont my code go in a loop??
 
so I have my code and it works fine but I need it to be able to run for an infinite amount of employees or 0 employees. After the function is called for the fir...
[1 reply] : This is updated code since for this project it was supposed to functio... (by jaredv11)
by marcb
Function/For loop help
 
I am trying to write a program that will translate phone numbers with letters in them into only numbers (ex. 1-800-flowers --> 1-800-3569377), but i am only get...
[1 reply] : for(i = 0; i < length; i++) { ch = phone.at(i); letter(ch); ... (by Enoizat)
by ICantC
std::cin and vector element edit
 
I have 2 questions, int itemCount = 1; for (const auto &i : database) { std::cout << itemCount << "." << " " << i.name << std::end...
[5 replies] Last: Thanks very much for the detailed reply, I feel like i've learnt a fai... (by ICantC)
Add integer to submatrix
 
Hello, First post, literally made the account to ask this as the assignment is due tomorrow night and I hope that someone can help me. I have had no experience...
[3 replies] Last: that was pseudocode. m[rbeg:rend, cbeg:cend] is not valid c++, just ... (by ne555)
Delete element from Deque ?
 
HI all ! I have to erase an element in deck . For example numbers 4,19,8,15 and when I input 2 (from keyboard-kratno) and must delete this el which divisible t...
[no replies]
Finding specific row or column in 2D array
 
Hello guys ! So i'm working on this task, where i have to find a specific column or row given to me by the user. But it works fine till i end up trying to d...
[4 replies] Last: Thanks works like a charm! I feel so bad for not realising how to for... (by FreeSocks)
Returning a number of periods using to_string
 
I am asking the user for a number and want to return that many periods in a row to the user using to_string. Here is my code: string dots(int a) { for(int...
[4 replies] Last: It seems that you did not pay attention to what jlb wrote in http://... (by keskiverto)
by Fewgod
one or more multiply defined symbols found
 
Hey I'm creating a text based game and I'm getting really confused when I tried to separate the functions in different cpp files so I can clear my main.cpp file...
[3 replies] Last: Thanks alot to both of you! I fixed my error and now the code looks mu... (by Fewgod)
counter gives output wrong
 
so i am reading from a file. i am trying to get the number of strings in the file. everytime the counter gives a wrong value if the file has three strings, it...
[2 replies] Last: ah i got it. thank you so much (by Echelon22)
2d array
 
write a program that simulates a drunk mouse movement on an island using 2d arrays Write a program that simulates the above game by inputting: size of the is...
[4 replies] Last: i didn't have the array initialized. i fixed it thank you (by Echelon22)
Need some help with my programming assignment
 
The assignment: http://voyager.deanza.edu/~bentley/cis22b/ass9.html I've been staring at the instructions for an hour now and I still have no clue on how I ...
[1 reply] : Hello awong918, Sorry I did not see this until today. For a start I ... (by Handy Andy)
Minimum and Maximum values returning as "0"
 
My program compiles and runs, but is returning "0" as the value for the minimum and maximum values. What am I doing wrong? #include <iostream> #includ...
[5 replies] Last: namespace nih{ double min(double a, double b); } int main(){ d... (by ne555)
C++ vs C# for games
 
Hello. I have been studying programming for a while. For work, I use the Python programming language. But as a hobby, I'm interested in applied programming. I...
[11 replies] Last: I created a new topic: http://www.cplusplus.com/forum/beginner/233472/... (by Jonikster)
Subscript out of range error
 
I dont understand why i get the "Debug assertion fail" error and it says vector subscript out of range. #include<iostream> #include<string> #include<f...
[6 replies] Last: I think you're right. If the last element is removed word_list will b... (by Peter87)
Basic I/O file stream
 
So, here is my problem. I need to do a ifstream of the variables down below, but I don't know how to do it since the variables are varying in length such 2 to 3...
[2 replies] Last: Use the three-parameter form of getline (http://www.cplusplus.com/refe... (by lastchance)
Problems with this pointer
 
Hey, i´m a student and I´m currently learning c++ and only recently I started programming the class Komplex in order to get a little routine. So far everyt...
[3 replies] Last: The operator+= does whatever is in the function written for it: Kom... (by Repeater)
Conditional Expression
 
I'm getting the error C4700: uninitialized local variable 'amountOfLoan' used. - I am trying to add a conditional expression to the code below. I am getting ...
[1 reply] : well i dont see where you initialized amountOfLoan. you never assigned... (by r6racer)
Using functions with arrays (1,2)
 
This topic is pretty much my sore spot. I can figure out how to create the function, but then calling it trips me up as well as any calculations needed inside t...
[29 replies] Last: no problem, glad to hear that. if you ever have any questions feel fre... (by r6racer)
by Fojaxx
something weird is happening. never seen before
 
Hey, so i posted earlier about my ratio calculator and asked about how to prevent a character from trying to be written into an int/double variable this is th...
[5 replies] Last: so for example cin.ignore(500, ' ') would ignore all characters up to... (by jlb)
Trouble using getline() and storing input till later use.
 
I am writing a class that uses an input facilitator function that will be used in another program to read from a .txt file. The .txt file reads as string (space...
[no replies]
March 2018 Pages: 1... 910111213... 29
  Archived months: [feb2018] [apr2018]

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