Beginners - September 2009 (Page 4)

why isnt this string of code working
 
cout << "The absolute value of\t" << a << "is\t %lf", fabs (a); a is the variable
[2 replies] Last: Kind of a mix of Python and C you've got there... (by Duthomhas)
How does std::map construct complex objects?
 
How does std::map construct complex objects if no constructor is written for it? class Complex{ float a,b,c; }; void main(){ map<int,Complex> Tes...
[3 replies] Last: It will. If you do something like: int a; , then a is not initial... (by firedraco)
learn C++
 
Where is he best place i can learn in depth C++.
[1 reply] : In your comfy chair at home, front of your computer... If you are a... (by R0mai)
by meesa
C++ Detect Buffer Overrun
 
So here is what I have: The user enters a number into an int. Now, I've solved if the user enters a character first, however, if there is a number first, I c...
[8 replies] Last: Okay, I got a solution. I added a boolian, and set it to false. Then,... (by meesa)
What can C++ do?
 
How powerful is C++? Can C++ do everything other languages can do? Thanks!
[12 replies] Last: You need a text book for sure, but learning it yourself IS going to be... (by isthan)
Dynamic allocation issue using ANSI C
 
Hi all, I'm trying to dynamically allocate a triple-dimension array, but I'm getting a runtime error exactly in the point I make the allocation, but I don't kn...
[3 replies] Last: Use of the %i format specifier is POSIX, not C. http://linux.die.net/... (by Duthomhas)
by robezy
Problem with using maps..
 
I'm solving one of the problems in UVa Online Judge. Problem statement below. A common typing error is to place your hands on the keyboard one row to the ...
[1 reply] : Use std::getline(). std::cin >> explicitly ignores whitespace. Another... (by helios)
Data Record
 
Hi, Suggestions required... I want to build a program in which i enter some data and after some period i want to read same information by entering the date. Ho...
[3 replies] Last: Do you want to write the data a file? If so, have a look at std::fstr... (by kbw)
cannot identify this error msg
 
#include<iostream> #include<string> using namespace std; class Person { public: string name,id; virtual string getRole()=0; string role; ...
[1 reply] : your Student constructor in line 43 is not defined. just add {} instea... (by hamsterman)
by cstroh
craps game
 
i have to create a craps game and i have looked at other code for it but mine doesn't need a betting system in it. this is what i have so far and it is sayi...
[2 replies] Last: Hi, this should work. #include <iostream> #include <ctime> #incl... (by bluezor)
How to calculate factorial of double variable (e.g. 3.2!)
 
How to calculate factorial of double variable (e.g. 3.2!)? I tried to write the following function but it gave me wrong answer! void factNumber(double nu...
[1 reply] : The formula n!=n*(n-1)*(n-2)*...*1 only applies when n is a natural nu... (by helios)
The this pointer
 
Does anyone know what the this pointer is used for in C++? I'm learning about it but I can't seem to find a true purpose to it. I'd imagine I would just call ...
[2 replies] Last: In many cases, though, it is necessary, especially when dealing with... (by Duthomhas)
a strange occurance while using fstream
 
i just give a part of the program i have write: f.open(mhs.txt, ios::in | ios::out); int i=0; char c ; do{ f.seekg((MAX_LINE+1) * i++); f.read(c, strl...
[3 replies] Last: @screw thx for your advice! (by orangorangan)
by res
parsing a txt file
 
hi. im a beginner on c++.(This is not a schoolassignment im doing this for my own amusement.) I want to read a text file,and try to extract certain parts of it ...
[1 reply] : Use the Xerces XML library to handle your file. http://xerces.apach... (by Duthomhas)
How to reduce fractions
 
So far im getting my fraction to equal a number. Code: if ((aFraction.numerator/aFraction.denominator) > 1) calculation9= aFraction.numerator/aFraction.d...
[3 replies] Last: I got it now! Thank you very much :) this is what i ended up with ... (by claud75)
Can't reverse the inputted characters
 
Sample Output: Type word(s): hello The reverse is 'olleh'. The problem is, I can't get it reversed. Please help... Here is my code... #include <stdio....
[3 replies] Last: thanks you very much screw!... (by aladar04)
if/else statements
 
For a project we are doing in class it involves fractions and since im begging im a little confused on the if/else statements. What im basicly trying to make it...
[1 reply] : nvm i figured it out now, thank you anyway :). (by claud75)
Recursive Quick Sort (Brain Exploded!!)
 
I am studying a recursive quick sort algorithm by C.A.R. Hoare. (a classic I presume). The code appears to be working properly. I totally get the concept o...
[7 replies] Last: Sorry, I didn't understand you.. :) (by screw)
by a9642
Best way to draw a pixel
 
I've been programming in high level interpreted languages for a long time now, and am trying to get into C++. The problem I'm running into now is that I can't f...
[6 replies] Last: I don't think I've ever seen a drawing library that didn't let you set... (by jRaskell)
my simple calculator loops but it doesn't display the answer
 
hi! I'm just a beginner. Can you help me out with this simple calculator? Here's my code. Thanks in advance! I was thinking if there is a problem with my usa...
[2 replies] Last: thanks guestgulkan (by aladar04)
September 2009 Pages: 123456... 23
  Archived months: [aug2009] [oct2009]

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