Beginners - February 2016 (Page 11)

Illegal else without matching if?
 
Hello guys, I am a new c++ user and I am having trouble figuring out this error that im given. I am creating a funny choose your own adventure kind of game, an...
[3 replies] Last: Remove the semicolon at the end of your else if statements on lines 30... (by brownflower)
by yamel
game: string or array for keeping track of number choices
 
Hi there, I'm looking to design a simple game in which the player plays against the pc by picking a number from 0-9 on his turn. Once he's picked a number, he ...
[3 replies] Last: First of all I want to compliment you on thinking about which data str... (by dhayden)
by cojeap
while loop not showing expected result
 
I made a switch from win to fedora, set everything up properly, but now my code no longer works....it compiles but instead of a number(a double) i get inf on m...
[16 replies] Last: so i fixed it, with push_back instead of emplace_back, and there was s... (by cojeap)
Max between 2 numbers
 
ok so i just started c++ and my teacher game me a homework. To calculate max between 2 numbers, if a>b than max=a, else max=b. I'm just playing with the express...
[5 replies] Last: Thanks. Now it's just perfect ! (by ralfitul)
Initializing a pointer variable
 
While C++ allows the use of char *b = {"Hello World!"}; why is it that doing the same with int does not work? i.e int *a = {10,20,30}; does not compile? Also, ...
[3 replies] Last: But you're not dealing with an array of char you're dealing with a poi... (by jlb)
Question about arguments of methods in C++.
 
What's the difference between these two arguments? void example(Number *obj) I believe in this first example i'm passing a copy of a variable which contai...
[14 replies] Last: But in the follwoing code i'm passing the reference to "increment", d... (by Moschops)
Limiting keyboard input
 
My program has a basic menu with options a-h, that leads to other menus and I was wondering if there is a way to limit the the user input to one character so th...
[3 replies] Last: For a clean and cross-platform solution I came up with this code: #... (by Tom56785)
by bjl311
invalid output help
 
i made a program that gives you a letter grade and average when you enter a number from 0 to 100. I'm missing one piece where the user inputs a number outside ...
[3 replies] Last: I second his comment^ (by WakeofMisery)
Function templates help!!
 
I need to write a function templates that can find 3 int,float,char,and strings long but when I use strlen or sizeof try to find the long but it doesnot work it...
[1 reply] : I'm not sure I understand your problem. "yile" is considered the bigge... (by Peter87)
Expected a list to output?
 
I am expecting a list of 9,8,7,6,5,4... etc... however for some reason when I compile the code below, the screen just flashes at me... If anyone wouldnt mind...
[1 reply] : solved: problem with my ouput operator overload. (by Outlaw782)
Initializing entire 2D array with one value
 
Hello, I want to initialize 2D array (matrix) with one value. I would like to say that for vector I can easily define as below double default_credibility ={0...
[6 replies] Last: yes , thank you . I should define function for initialization. however... (by glitter)
Inserting decision into code
 
post removed
[1 reply] : You don't have to use a do-while. However, you'd have to modify a few ... (by YFGHNG)
by Ellkoy
Nested If errors
 
(This is for a lab assignment) I have 9 errors, Syntax and missing ; between lines 64 and 129 (sorry!). I'm sorry if this is daunting but I'm really lost. Can I...
[2 replies] Last: Pay attention to those error messages. If they're all saying the same ... (by YFGHNG)
by djash
help
 
Write your question here. I have to Create the following program which converts Fahrenheit to Celsius. Your program must have the following functions: •Read ...
[1 reply] : For one, it'd be better from a visual point of view if you were to use... (by YFGHNG)
Calling functions in main.
 
I made some functions outside of the main and I want to call it back in the main. class Pizza { private: int type; int size; bool cheese; ...
[4 replies] Last: Ah! Thank you. (by jibicax)
for loop not storing a value for position 0
 
I am having an issue with my last for loop in my program. It is not storing any value for position 0 and it's printing out the null values. Here is my program. ...
[2 replies] Last: @Chervil Thank you so much! With that little change I was able to pri... (by plsalinas)
Combining nested ifs with multiway ifs?
 
Hi, everyone! I need a lot of help with my program that I'm writing for my gen ed compsci class. I'm trying to combine multiway and nested if statements, if tha...
[1 reply] : Btw, you're doing it wrong. It should be: if(letter == 'C') You n... (by DeathLeap)
function call issue?
 
Program is supposed to calculate shipping(using void functions for both standard and premium memberships) and then display total cost. I keep getting 0 for the...
[5 replies] Last: Thanks DeathLeap but it would still have premium shipping 0.00 I had ... (by Billyin4C)
by KTlady
Creating a 6 digit password
 
Hello, I need help with a following project. I am suppose to create a code that allows a user to put in a six digit password and it has to follow the following:...
[1 reply] : At least try to code something, don't just ask someone to do it for yo... (by DeathLeap)
Hello. Need help inserting at the end of a linked list
 
Hello everyone. I've started data structures this semester, I wasn't expecting to but had a sudden schedule change. I haven't touched c++ in a while so forgive ...
[1 reply] : So I'm home now, it compiles but I get segmentation fault. Any ideas w... (by TheCoolest2)
February 2016 Pages: 1... 910111213... 46
  Archived months: [jan2016] [mar2016]

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