Beginners - February 2010 (Page 7)

by wasabi
Program runs on two computers, not on third
 
I wrote and compiled a program on a Windows XP 32-bit computer. I then tried to test it on another computer, which didn't work. I then realized this computer wa...
[15 replies] Last: This forum can be quite scary at times. (by tummychow)
by EEVIAC
can't get sample code to compile
 
Here is some sample code out of a book that won't compile.. The error says that it can't find the "xxx.exe" file that I'm trying to compile/run. #in...
[5 replies] Last: Or it might never happen. But when I see a bump I feel strongly unwill... (by tummychow)
Getchar() Doesn't Work on Conditional Control Statement
 
Hello Everybody! I am a beginner that try to learn C++ programming. I work in Linux Ubuntu Karmic Koala (9.10) environment. I got a problem with getchar()...
[9 replies] Last: @ Dear Zhuge, Thank you for your nice information :) (by windscar)
by EEVIAC
simple program won't compile
 
All I'm trying to do is get the tree() function to display the output and it won't compile.. :( #include <iostream> using namespace std; void tree(); ...
[3 replies] Last: thx.. added int to the main() :) (by EEVIAC)
by oman
read substring by reverse
 
how i can read reverse what display by substring............?
[4 replies] Last: Actually he is giving away the answer. Sure he is not giving the EXAC... (by firedraco)
Playing Sound
 
On a windows computer is there a way to play a beep with a certain pitch for a certain amount of time just like Beep(2000,1000); //beep at pitch 2000 for 10...
[1 reply] : Sure, load the sound driver then pass it raw data until you like the s... (by Computergeek01)
Not enough memory for c++ code???
 
Hi, I have the following problem: I have a program which reads from a tex file and makes some calculations. The text file consists of several thousand data. ...
[11 replies] Last: You're writing to memory you don't own. I don't understand why that ma... (by chrisname)
Fractions Evaluating to 0
 
I'm writing a simple program to convert temperatures from Fahrenheit to Celsius and Celsius to Fahrenheit, and I've found that my fractions are evaluating to 0 ...
[1 reply] : return (input - 32) * (5 / 9); Look here. 5/9 = 0 because its int... (by eker676)
by EEVIAC
converting distance in furlongs to yards
 
This program converts furlongs into yards. 1 furlong = 220 yards You run the program, and it asks you to enter a distance in furlongs. You enter a number, pr...
[3 replies] Last: YQW, good luck :) (by BettyBoopTS)
The address of a literal (1,2)
 
Hi there! I'd like to know why I can't take the address of a literal directly . For example in that way: int* ptr = &10; But this code is correct: ...
[27 replies] Last: [quote=Duoas]From the high-level perspective, just remember that unles... (by Quentin)
by wasabi
Appending strings
 
I'm reviewing some code written by others and bumped into the following line of code: fdat.push_back( itr->leaf()+"\\"+fdat_i ) Where itr->leaf() and fda...
[2 replies] Last: Thought so. I knew it didn't work with c-string (char arrays)... God ... (by wasabi)
iostream string to int conversion
 
My function looks as this: [code firstline=173] bool gotInteger(const string& str, int& i) { istringstream ss(str); return ss >> i ? true : false ;...
[2 replies] Last: DOH! dammit I even looked it up, thought it was part of iostream. :P ... (by gcampton)
formatting information
 
Thanks for the previous help. I have a new assignment, I have to write a program that applies various charges for a gas meter reading. I am trying to figure out...
[3 replies] Last: its basically the computations for the code. I need to write a program... (by airwulf)
case insensitive find
 
I need to parse an input file that contains functions and comment lines. But the functions are case insensitive so I need to figure out a way to find the funct...
[3 replies] Last: mmm thanks guys. I really hope std::string class gets extended in "... (by gcampton)
One Function inside another one that is called in the main()
 
I have the function of get_a_b_c(a, b, c); inside this other function double bb_4ac(); in which is called inside the main () I get all kind of errors like cr...
[6 replies] Last: Sorry for that Disch. I misunderstood what my teacher told me about fu... (by olredixsis)
For loops: How does c++ know when they end?
 
I'm working my way through "Beginning C++ Through Game Programming Second Edition" and on chapter 3, I'm introduced to "for" loops. The example code is as follo...
[3 replies] Last: Ah, I didn't know you could put multiple statements on the same line w... (by bustaballs)
by EEVIAC
calling fuction for variable in main()
 
#include <iostream> using namespace std; int tree(int); int main() { cout << "How many more days until it rains?\n"; int cake; int cake = ...
[4 replies] Last: You could always condense int cake; cake = tree (55); to the much... (by tummychow)
Recursion assignment: print integer with commas
 
Trying to learn recursion. Problem asks to use recursion on non-negative number to insert commas. Ex: 20131 as 20,131. My program adds in an extra comma at end....
[3 replies] Last: Thanks hamsterman. I played around with it and somehow got it working.... (by ctrahan)
Command Prompt Errors
 
Hey guys when I run the following program the command prompt pops up but the data does not load can someone tell me what I am doing wrong. customer.h #...
[4 replies] Last: You're also deleting your myCustomer array wrong: // if you allo... (by Disch)
Quick question about pointers
 
struct Student { string name; // or char name with the max number of characters allowed in a name double gpa; double cur_Hours; Stude...
[5 replies] Last: No, it's that you can't have a statement outside of a function. The on... (by chrisname)
February 2010 Pages: 1... 56789... 32
  Archived months: [jan2010] [mar2010]

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