Beginners - December 2018 (Page 11)

c++ food menu loop
 
Write your question here. Hey I cant figure out where and what type of loop I should put in to get my if statements to activate every time the user inputs y or...
[1 reply] : what you are looking for is a while loop 1) print the Menu 2) get inp... (by adam2016)
[Error] for Linked list
 
I am receiving the following error when compiling my code. I am unsure what I am doing wrong. Error: Severity Code Description Project File Line Suppressio...
[2 replies] Last: 'createnode': ... Look at the function createnode must return a v... (by lastchance)
Reading a text file to create a double vector
 
Hi everyone, I'm a beginner in using C++. I would like to read in C++ 2015 a .txt file like this: A 1.1 B 0.006 C 2.15 D 2.90 So I have names (charact...
[4 replies] Last: Hello MakeMeFeel, My bad. I should have made the " std::string junk; ... (by Handy Andy)
std::initializer_list and move semantics.
 
Hello, I am having problems with using initializer_list when I am passing object that only support move constructor and move assigment. #include <memor...
[2 replies] Last: Thanks for clarification :) (by Unspoken)
Random Shuffle Error
 
I'm trying to use the random_shuffle but for some reason I'm getting an error and I can't work out why. Could someone have a look please. include "pch.h"...
[11 replies] Last: So what does that have to do with any of the problems you've asked pre... (by jlb)
Printing into different lines.
 
How do I print out my answer into different lines without writing each line manually? (a=3, b=8, x=3). data answer 3 8 3 3 6 4 7...
[3 replies] Last: Your approach doesn't work, since I still have to type everything man... (by MikeyBoy)
by asxxx
Max element in array
 
How to find a max element in array using only pointers?
[11 replies] Last: I would use the suggestion of using the STL algorithm; however, it s... (by chicofeo)
[Error] expected primary-expression before ....
 
Wonder if anyone can tell me what I'm getting wrong on this. I keep getting errors on the last line: 26 37 C:\Users\DSNoS\Documents\CPP Projects\Address...
[3 replies] Last: When you declare and define functions, you specify the data type. Wh... (by Repeater)
Programming a data Converter
 
Write your question here. Hello, i Need help with a Project i have! I wanna interact with a data file from a Game on the Computer the Problem is, i can't ...
[1 reply] : if you know the file's format, you create a structure that holds the f... (by jonnin)
return statement with '?' and ':'
 
Hi guys, can someone explain to me the code below? I have never seen this '?' and ':' like this in a return statement. double tracer::anglefinder(doub...
[7 replies] Last: Note that "ternary operator" means an operator that takes three argume... (by Peter87)
Logging in using a file
 
I'm attempting to make a function that reads a user ID from user input, checks a file for that user ID, and logs them in if it is found. No password. I have ...
[1 reply] : #include <iostream> #include <string> #include <fstream> #include <li... (by JLBorges)
Not displaying anything but zeros as outputs.
 
I'm only getting zeros as output and don't know why. #include<iostream> #include<cmath> using std::cout; using std::cin; using std::endl; //declarati...
[2 replies] Last: Thank you. Was driving me crazy. All fixed and working good. (by SDstang)
by snew18
Write c++ program: create a stock class
 
Hello, having some trouble with this program. The array in the main function won't work as I keep getting an error. Question: An Equity is a stock or sha...
[1 reply] : https://stackoverflow.com/help/how-to-ask This isn't sufficient: He... (by TheIdeasMan)
block Access
 
I need to keep track of the available, or free, blocks in the file. Rather than maintaining a separate list of the free blocks, we can allocate some space in ea...
[1 reply] : It will be difficult to answer this question without context about the... (by mbozzi)
by ozicek
Visual Studio different output from Primer book exercise
 
Hi, I'm following the C++ Primer, for the section 1.4.4, when I type the code into Visual Studio it doesn't show the last entered input how many times occurs. B...
[1 reply] : my guess is that you don't know how to terminate the input. (how to se... (by ne555)
Proccessing Data
 
When deleting from the data file involves moving records to fill the empty slot. This could involve moving records across block boundaries and could result in ...
[no replies]
by arlarv
How to properly read a file into multiple arrays
 
How do I properly read from a file that has both strings and numeric literals into an array for each? For example, I have a text file that lists 10 peoples last...
[2 replies] Last: The error I get is: no match for 'operator>>' (operand types are 'st... (by arlarv)
Need Help with extra credit project for class #2
 
Project 2: Sailing the Seas (Yar har deedle dee dee, you are a pirate!) Implement a sailing game. The Sailing Map 1) Create a two dimensional 10x10 charact...
[1 reply] : I am highly confident you misunderstand the purpose of the forum; howe... (by chicofeo)
Binary search help
 
Hi, I've been given a simple task of outputting the middle item from a given data. The data is already sorted. I created a code which compiled successfully y...
[1 reply] : You are mixing things. There is no "search" involved. Middle item is ... (by keskiverto)
Need Help with extra credit project for class #1
 
Hello smart people! So this is my first c++ class a=in college and i like c++ the most out of all the languages but professor put up extra credit which is real...
[1 reply] : you need to write some code and ask a question about where you have tr... (by jonnin)
December 2018 Pages: 1... 910111213... 22
  Archived months: [nov2018] [jan2019]

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