Beginners - February 2018 (Page 13)

Storing items from file into array
 
Hey all, I'm trying to write a code that reads from a tsv file and prints the items, from the date interval entered by the user, in reverse chronological order...
[1 reply] : I'm trying to write a code that reads from a tsv file You may want ... (by jlb)
[HELP] Sentinel Controlled Dynamic Array
 
Hello friends, someone help me please! Write a code to take integer input in 2 dynamic arrays as long as the user doesn't enter sentinel value. After you hav...
[1 reply] : std::vector<int> v1, v2; int n; while(std::cin>>n and n not_eq centin... (by ne555)
reverse order
 
hello all, i'm suppose to give the output in reverse order. in the code below, is the regular order. I'm having trouble of how to reverse it #include <ios...
[no replies]
Tic-Tac-Toe source code explanation
 
Hello, I have been analyzing source code of the game called Tic-Tac-Toe and I can not understand one particular part. Can you help and explain me why it is need...
[1 reply] : http://www.cplusplus.com/reference/istream/istream/ignore/ http://www.... (by closed account E0p9LyTq)
*.exe has stopped working
 
Hi, I am new to C++ coding. Wrote c++ code to calculate LCM of series of integers. Below is the code #include <iostream> #include <vector> #include <list...
[6 replies] Last: The original does crash if you put in the same value twice, like {10,1... (by jonnin)
by Vinz24
add, average and reverse in 1 function
 
the codes run it is i want. But the problem is how to make the addition, average and reverse will be in one function? #include<iostream> #include<stdlib....
[10 replies] Last: Bah humbug, I just want numbers to show: int total {}; double avg {};... (by keskiverto)
Making a calendar
 
I am making a calendar that should just have some basic features. Like setting dates and checking spesific dates. I've made a class for setting dates, which als...
[no replies]
How to continually add user defined amount of numbers?
 
I am writing a program that would have the user input the amount of rooms in their home along with their measurements (Length * Width). The program would then c...
[3 replies] Last: No problem! To have the += in the other function you mentioned, this... (by Misenna)
No output from reading a simple string in
 
This simple code should output the name string but doesn't for some reason. The file its reading is this format and exact info: January 3.2 February 1.2 Marc...
[3 replies] Last: You might want to try this: #include <fstream> using std::ifstream;... (by Misenna)
Code not reading array accurately
 
My program reads an id, math and English score from a file. the math is stored in math while English is stored in eng . These scores are then passed onto a fun...
[3 replies] Last: Well, only the last check will be successful because you check in math... (by coder777)
by Millet
How do I return the smallest member of an array?
 
How do I return the smallest member of an array using an abstract function?
[2 replies] Last: std::min_element() It returns an iterator: just dereference it with *... (by lastchance)
Need help with a class assignment.
 
I was assigned to make a console app that when debugged should ask for a month then ask for a year then it should determine whether it is a leap year or not. Th...
[4 replies] Last: int main() { int year; int month; cout << "Please enter a mont... (by EmmyScott)
Trouble with C++ Lab problem.. Please check my coding! Error in the output
 
Assignment details: http://storm.cis.fordham.edu/leeds/cisc1600/lab1.pdf ... I feel like I put some things in "double" that should be in "input" and vise vers...
[3 replies] Last: somethings wrong Please read: http://www.catb.org/esr/faqs/smart-que... (by mbozzi)
trying to get multiple inputs, program closes after one
 
Hello. I am a complete noob when it comes to C++. This is a homework question. Feel free to either tell me exactly what I am doing wrong, or give me a hint. I h...
[3 replies] Last: Please provide a sample input that exhibits this problem, and the prog... (by mbozzi)
Having trouble formatting and inserting $ sign
 
Hey everybody! Im doing a project for my fundamentals of programming class and I'm almost done but Im having trouble inserting a dollar sign ($) next to the val...
[4 replies] Last: Use a compiler/library that is not ancient, and enable support for C++... (by JLBorges)
defining bi-dimensional std::array
 
Hello everyone, I get this error with the below code : "too many initializers for ‘const std::array<std::array<int, 2>, 5>’ " class mydata { std::...
[7 replies] Last: > Now I can initialize my bi_dataM member. Initialise it in the const... (by JLBorges)
Singly Linked List
 
Hi I need to make a singly linked list that displays in order the input from the user and displays NULL is the input is o. While I have most of this done, ever...
[1 reply] : do { if (data == 0) { cout << "NULL" << endl; ... (by Ganado)
by dubley
question about reference
 
Say at line 80 cin >> po; I enter 1, and then line 84 st.push(po) ; calls push and passes the argument with a value of 1, I do not understand why item in the ...
[3 replies] Last: Thank you very much for your explanation. (by dubley)
getline function
 
I am using the getline function to read until the end of the line when the user enters a movie title. I am having problems because it reads the movie title unti...
[3 replies] Last: cin >> movieName; getline(cin, movieName); So the first sta... (by lastchance)
rand() always gives same number
 
I just started learning c++ and I was trying to recreate an old blackjack program I had made in high school to test what I have learned in my course. Anyway,...
[3 replies] Last: Thanks so much! These were both very helpful! (by Nilwood)
February 2018 Pages: 1... 1112131415... 28
  Archived months: [jan2018] [mar2018]

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