Beginners - May 2013 (Page 8)

What does in_file.unget do in this case?
 
Im trying to understand what the in_file.unget does. In my text, it says "it can be used to see if the next value is numeric or text" So i tried this example ...
[6 replies] Last: if you entered MAY 2013 in the code above there would be no output bec... (by Yanson)
print contents a file that had been transferred into array
 
how to see the contents of the array after i use infile>>ecg which means the file already being loaded into arrays. below are part of the codes. I used linux a...
[4 replies] Last: thank youuu :) (by HayatiYassin)
2d arrays
 
yeah I am having such a hard time picking up 2d arrays, regular arrays was easy. 2d arrays is killing me. i can make the multiplication chart and etc. but...
[2 replies] Last: I did that bro, its like I can do that aspect. but when they ask me to... (by science)
Problem with hashing logic
 
I'm having trouble figuring out the logic behind searching for an object that has been hashed. It's nothing like traversing a link or vector to find a field th...
[2 replies] Last: A hash table can be a simple array: int table ; items are inserted ... (by Lowest0ne)
by diablo
sum
 
Hey guys.Just did a program using pointers that adds two numbers but it doesnt work for negative numbers.Whats missing? #include<iostream> using namesp...
[4 replies] Last: Well i read a string of numbers and without that -0 i cant display cor... (by diablo)
by ASF93
creating grid(matrix), C++
 
Hi i'm trying to write a program that print a grid (as many as the user inputs). For example if the user chooses to print 5x5 grid it prints it with random n...
[3 replies] Last: THANK YOU. that worked! (by ASF93)
by Hvqc
How can I make a loop wait before repeating?
 
I've been reading Jumping into C++ by Alex Allain (really good for getting started with c++, I recommend checking it out if you haven't already) But I'm on the...
[1 reply] : Nevermind, figured it out :D (by Hvqc)
help with understanding some commands
 
Okay so I'm new at trying to learn programming and I have a few questions. I'm using the accelerated c++ book and I kind of don't understand what some of the st...
[1 reply] : 0. const ants cannot be modified once they've been initialized. 1. Ma... (by helios)
Why is address passed when parameter is pointer?
 
Assignment is to create a function that accepts a pointer to object "Sample", but when calling the function I need an "address of" as the argument. Why does thi...
[2 replies] Last: Your answer made me think of something probably mentioned long ago in ... (by Ima767god)
help with classes
 
If i am compiling the following code, I am getting an error: CODE: #include <iostream> #include <stdlib.h> #include <stdio.h> using namespace std; ...
[1 reply] : Compare how you called add_length and the other member functions. With... (by Daleth)
Question about conditionals
 
I have some questions about the conditions after "if" so when I typed: float num1,num2,num3; num1=1.3; num2=3.5; num3=-0.7; if (num1==1.3 && num2==3.5) {...
[4 replies] Last: Doesn't matter if it's a floatin' or a doublin'. http://learningcppisf... (by Daleth)
by Blank
the !operator
 
i dont have trouble understanding the && operator or the || operator but when it comes to the !operator i dont understand it for some reason. here is an example...
[6 replies] Last: ahhhh i see... it took me a while but i think i get the concept now. i... (by Blank)
by yeki
Matlab2C++
 
Write your question here. Hello All I have a Matlab code and I want to convert it to C++, this code is full of matrices, and to define them in C++, it took mo...
[2 replies] Last: yes that's my code #include <iostream> #include <cmath> using names... (by yeki)
by bjt223
Function
 
The objective of this assignment was to that each player roll a dice and the highest dice roll wins. This should allow each player to roll by hitting the "Enter...
[4 replies] Last: Well, cin requires an input to continue, so hitting enter in that case... (by Ispil)
by hoity
Hamming weight
 
Can anybody please explain the following code portion here. int count_set_bits(int N) { int result; while(N) { result++; ...
[3 replies] Last: Thanks everybody :D (by hoity)
Need better understanding about Type Qualifiers
 
It appears that there is no explanation about type qualifiers. I did some surfing and found out that there are 3 type qualifiers, that are : const, volatile, an...
[5 replies] Last: yeah const is useful and important. I forgot to mention that. (by indojo24)
infinite amount of variables
 
So I have the problem that I want the person to input as much information as they want to, but I don't know how to make this work using variables. For example o...
[3 replies] Last: thank you very much for the help! (by what the program)
Derived Classes
 
What is the difference between the following two definitions? Like how does the public affect the behavior of the derived class? class ForRent : public ...
[7 replies] Last: Virtual just means, forget what type the pointer is and just follow it... (by Ramzi89)
Setter not storing updated value
 
I tested a cout in the class function itemsOrdered and it prints the updated value, but the setter does not store the updated itemQuantity value in the construc...
[6 replies] Last: So essentially: do { int x = 42; } while ( cond ); Rather than mod... (by keskiverto)
Can some one check my function Please!
 
Hi I made a function called inventory for my RPG and it is not working the way I want it to when the user selects a potion to drink. it just out puts "cout<<"Ty...
[3 replies] Last: Oh wow, I completely forgot about that! Thank you very much vlad! (by sakonpure6)
May 2013 Pages: 1... 678910... 66
  Archived months: [apr2013] [jun2013]

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