Beginners - January 2011 (Page 10)

double
 
when do we use double,,, like there is a program to read prices of 20 items in array and find there sum of all the pricwes, product of all the irems and the av...
[3 replies] Last: for when to use double, http://www.cplusplus.com/doc/tutorial/variabl... (by closed account 4Gb4jE8b)
by Zyborg
Why does this work?
 
I am currently working through the book "Accelerated C++" and I've come across an example that I don't understand. The example given is supposed to make the re...
[5 replies] Last: Interesting. Thanks for the info Intrexa and filipe. (by Zyborg)
What happens if you omit the .close()
 
When working with text file input and output (or any I guess) what happens if the close() is omitted? Is it similar to a memory leak, or creates a corrupt file...
[2 replies] Last: The file will be automatically closed when the stream goes out of scop... (by PanGalactic)
basic question on namespaces
 
Let's say I have the following simple program: #include <iostream> #include <cmath> int main() { std::cout << "5.5 squared is " << pow(5.5,2); retu...
[1 reply] : Is it because pow() comes from a C header file? Yes Should I... (by Disch)
I still don't know pointers...
 
Well I've been programming for a fair amount of time and I still don't know pointers. Does anyone have a program idea that I can make that is pointer heavy? I...
[14 replies] Last: I looked up linked lists and it just went in one ear and came out t... (by stereoMatching)
Could not match operator.
 
A simple calculator, but yet it keeps saying could for the first if statement not match operator. #include <iostream> #include <cmath> using namespace std...
[2 replies] Last: Or change all comparison to string instead of char. symbol == "a" ... (by sohguanh)
vote1
 
can someone help me to do the program that reads age of a person and tells wether the person can vote or not. Ages should be written in a text file and output ...
[5 replies] Last: only this code: top=-1 size=10 Function isFull() if(top==s... (by dashboard11)
linked list queue?
 
Hi. I've been studying c++ for a couple months now, and I've ran into a snag in the book I am using for study, "C++ Primer 5th edition". Its the concept of a ...
[2 replies] Last: Thanks for the reply. I'm starting to get it. For linked lists, recu... (by flclempire)
Guessing game doesn't work right
 
OK so I'm very new to programming and have gone through a few tutorials and was hoping to create a very basic guessing game. I want it to identify the player th...
[10 replies] Last: yeah the random seed being in there twice was me moving some stuff aro... (by xxsokol32xx)
by Zyborg
trouble with a 2d asteroid game
 
I am currently working on a 2d asteroid game with SDL and I have run into a problem I can't fix. The player controls a ship and shoots lasers. I have a class ...
[3 replies] Last: If anyone is interested, you can download a zipped executable of my as... (by Zyborg)
two-dimensional dynamic char array
 
Hi, I'm trying to create a 2d dynamic array that asks the user to enter however many words they want, then display these in reverse order, like such: H...
[2 replies] Last: is there any particular reason you can't use std::string and make your... (by Disch)
Avg Netpays
 
Can you guys take a look at the below? I am to calculate netpays for 5 employees w/ the class structure. The code will not compile and I believe the problem lie...
[2 replies] Last: 2 things, at the end, int main() { payroll employee; employee.pr... (by Intrexa)
by miang
Determining screen resolution in c++
 
Hey, thanks for taking the to read this! I've got a question, how do you get the screen height and width in c++? The gdk library has the functions gdk_scree...
[1 reply] : There's no way to do it with just the standard libs because the standa... (by Disch)
Easy way to input into a string array?
 
Assume you have a variable x, and a string called stringx. (With size 26, for example) What would be the correct way of inputting x into the next available s...
[1 reply] : This should work: stringx += x; (by Browni3141)
Declaration of long int*
 
Hi, I'm trying to use this piece of code as a random number generator: float ran0(long *idum) { long k; float ans; *id...
[1 reply] : Read: http://cplusplus.com/doc/tutorial/pointers/ You won't need a... (by firedraco)
by zeos
i can't RESOLVE a PROBLEM !!!!
 
the error is Active.cpp: In member function `void Fetcher::fetch()': Active.cpp:173: error: `mytext' undeclared (first use this function) Active.cpp:17...
[19 replies] Last: the probleme is resolved thanks you Mr sadavied it work perfect... (by zeos)
function to output file problem
 
I have a lab that I have been working on and need a little help with it. I am trying to call the do_stuff function, get user inputs for 4 numbers (n1, n2, n3,...
[6 replies] Last: Man..Thanks filipe i was looking for this for ages. :) (by Alex cpp)
strings
 
Hello I have char with big text how i can extract every single word in different char ? I have tried that: void main() { int n = 100; char* arr =...
[5 replies] Last: hi friend, im beginer too , i see "single word" in your question and n... (by hasula)
by pooshi
Passing a file to a function
 
I have a question about passing a data file into a function. I want the user to enter data.txt, which is the file that holds the data for the program. My pro...
[4 replies] Last: Thanks again Bazzy. I got it! (by pooshi)
Create .txt files in c++
 
I need to make a program that gives you the chance to write what you want and then it saves it in .txt. But all I got so far is this: #include <iostream> ...
[5 replies] Last: I've managed to do it in an easyer way, thanks to all! (by Alex cpp)
January 2011 Pages: 1... 89101112... 42
  Archived months: [dec2010] [feb2011]

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