Beginners - February 2014 (Page 51)

Reading a file one line at a time using a function, but I can't get past the first line
 
So in my assignment I have a .txt file from which I have to read from it one line at a time and do some stuff with those values. I'm using a while loop to call ...
[8 replies] Last: No because it will continue from where the stream left off ( if you pa... (by giblit)
COUT not working properly
 
May someone please help me why my COUT are not being shown on the Dos Console. The only message being displayed on console are everything written under void m...
[6 replies] Last: Thank you Disch! Seem to get a better understanding of flush now! :) (by fahmankhan75)
getting numbers from a text file
 
Hello guys, I have a problem in reading a set of numbers from a text file. The text is as follows 2 3000 P 500 20 200 L(3) 300 U(3) 400 A 2 10 500 ...
[1 reply] : If they are always going to be in this order you could use operator >>... (by giblit)
SDL collision
 
The code works fine but the thing that i find confusing is the collision function In line 7: if square's y-axis is greater than the walls y-axis + the wall's he...
[no replies]
by jwilt
big number in array
 
How can you store a 30 digit number (ex. 132546351365841354646135456789) from a file with one digit per place in an array?
[4 replies] Last: Getline streams the entire line for you so you must include the input ... (by giblit)
by RabMac
Member Function for calculating total
 
Hi, I was wondering if someone could help me with this problem. I need to write a program that takes values from a file and assigns them to an array. It then...
[3 replies] Last: Hi Stewbond, Just wanted to thank you again for your help, it was rea... (by RabMac)
Confusion on how to write the code
 
ask the user which item they have, and how many cubic meters they have. Display the total mass of the item. You should allow for non-whole numbers. How do...
[5 replies] Last: Thank you all (: (by BuddhaTwo)
Writing test program
 
So here is what I'm working on. I have a website that I'm programming that will be members only and verifies members by a eight digit code they must enter. This...
[no replies]
by sean B
Creating a For loop Menu and understanding it
 
I created a for loop menu because I am trying to understand when not to use specific loops and when to use specific loops. I know a do while loop are best for t...
[6 replies] Last: FWIW: int i; for (; i!=3;) Note that 'i' is not initiali... (by Disch)
by xpg94
Random produces same data for each object
 
I'm trying to do this exercise, which is to make 5 bunny objects for beginning,and each needs to be male or female,and according to it's sex, it receives male o...
[4 replies] Last: I suggest an enumerated type for their sex instead of a string. http:... (by heyyouyesyouiloveyou)
CCC 2013 Question 3
 
I am not very experienced at c++ programming so can someone assist me in question 3 of CCC 2013? http://www.cemc.uwaterloo.ca/contests/computing/2013/stage1/...
[1 reply] : How would you do it on paper? (by kbw)
Using a For loop and pointer to reverse output
 
I'm having trouble understand how to reverse my output using the For loop. At first I thought I could just replace the ++ with --, but that obviously didn't wo...
[3 replies] Last: Well, somehow, I came up with this and it works, however it goes throu... (by mathisona)
by gduong
Dynamically allocating memory inside class
 
I am having a problem with dynamically allocating memory using a class. When it compiles and gets to the console, I get a Debug Error. IT says Invalid allocatio...
[8 replies] Last: Thank you. I put a destructor in my code. Here it is. //Program tha... (by gduong)
by chry44
output help
 
i didn't understand why the output of this code is 1? can someone explain to me please? Is it because B is bigger than A; if yes why? thank you!! #include <...
[7 replies] Last: thank you again :) (by chry44)
Good software to code in C99? + some questions on bit masking
 
Write your question here. What is a good software to code in c99? Something like eclipse will be awesome. 1) /* Divides and takes the floor of a value ext...
[6 replies] Last: I suspect I need to create a .c file and everything should be same as... (by Catfish666)
by MrFoo
default constructor
 
Hi there, in my book here: Defining the Sales_data Constructors For our Sales_data class we’ll define four constructors with the following parameters: ...
[3 replies] Last: > there are things you won't be able to do with that class, such as us... (by ne555)
by jwilt
numbers to long
 
my program works fine when the numbers stay below 10 digits in length, but once I hit an 10 or greater digit number the program bombs. I believe the problem is...
[1 reply] : Numeric limits: http://www.cplusplus.com/reference/limits/numeric_limi... (by keskiverto)
segmentation fault, but no compiler error. simple program
 
Hi, I have a very simple program that reads a file line by line and stores each line in a 2-d array. The program complies without error and runs correctly wh...
[2 replies] Last: > The program complies without error After adding the missing brace in... (by ne555)
Need help for this project in C
 
Wm having problem with getting this loop to work #include <stdio.h> #include <stdlib.h> /* EEL4834 Assignment 3 Part 1 of project make the Heq Analyzer v...
[no replies]
Solved.
 
I'm working on creating this, however, my program gives me a weird integer binary value when counting the occurrences. For example, when a decimal is entered, i...
[8 replies] Last: I wanted to test out your code, however, when I try to compile it, it... (by cire)
February 2014 Pages: 1... 4950515253... 60
  Archived months: [jan2014] [mar2014]

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