49,757 Topics

Member Avatar for
Member Avatar for raptoro104

I'm reading Larry Ullman's C++ Programming:Visual Quickstart Guide. He says to use the command std::cout.setf(std::ios::fixed)) (with others) to set the number of digits after a decimal. But all of his code uses std::cout::setf(std::ios_base::fixed). What is the difference?

Member Avatar for raptoro104
0
114
Member Avatar for newbie2c++

Hi everyone, I have written a program and have encountered a few errors that I can't seem to fix(or don't know how to), any help would be great. Thanks in advance for the help! I'm very new to this so bare with me!:cheesy: [CODE] #include <cstdlib> #include <iostream> #include <iomanip> …

Member Avatar for John A
0
98
Member Avatar for sunny123

ive created this currency conversion program which converts the currency then adds commission, but its got a error saying undefined symbol true in function main can someone help me ive only got the one error with it. [code]#include <iostream.h> int choice; double pounds; double USdollar; double Euro; double interest; int …

Member Avatar for John A
0
92
Member Avatar for Francis Waldron

Here is another shot at it. It all most complier but falls short . still I know it doesn't mean its right. thanks for the help so far.

Member Avatar for iamthwee
0
167
Member Avatar for kabrina

Hi, I'm more than likely in the wrong place and if I am can somone please direct me to the right place! Heres my query. I am an [URL="http://www.daniweb.com/techtalkforums/thread62723.html#"]online[/URL] promoter and I do a lot of my promotional work by sending out thousands of messages a day on social community …

Member Avatar for jwenting
0
103
Member Avatar for dmmckelv

I am having some trouble with the logic for my constructor. The constructor is supposed to open a object of class Rational. The constructor is also supposed to check to make sure the denominator is not zero, the denominator is not negative, and either reduce the fraction or make it …

Member Avatar for dmmckelv
0
376
Member Avatar for joelw

ok, i need help writing a program that stores data about a basketball player in a structue. I need to create a structure for players name, players number, and by points the player scored. I need to keep an array of 5 of these structures. Which each element is for …

Member Avatar for may4life
0
187
Member Avatar for Lost in Code...

I've lost my will and need some guidence, yes this is homework, i'm not going to lie about that. I know I could probably figure out how to get the answer she's wanting, but not with what she's provided as a code template below. I'm guessing that I need to …

Member Avatar for Ancient Dragon
0
262
Member Avatar for joelw

ok i got the program written and was wondering how i would write code that will then add all scores together and give the rusult? here my program. [code] #include <iostream>#include <iomanip>#include <string>using namespace std;const int SIZE = 25;struct Players{ char name[SIZE]; //Player's Name int playNum; //Player's Number double Points; …

Member Avatar for Ancient Dragon
0
69
Member Avatar for newbie101

I am trying to get this code working for extra credit, but I unfortunately only have 40 minutes until it is due:rolleyes:. I would like to know how to do this program, whether I turn it in or not. The letter "Y" can be considered a vowel if there is …

Member Avatar for Ancient Dragon
0
170
Member Avatar for Barefootsanders

Hey guys, I was writing code or DLL's (doubly linked lists) and I think I have everything right but it keeps giving me a makefile error. My code is below along with the error log. ANy help would be apprecaited. [CODE] //DLLNode.h #include <iostream> #include <cstdlib> #ifndef DOUBLY_LINKED_LIST #define DOUBLY_LINKED_LIST …

Member Avatar for Ancient Dragon
0
177
Member Avatar for yadavvirendra

:idea: im currently working on mechanical design based project . plateform is windows & language is c++ ,& for gui(graphical user interface) vc++, in vc++ when i run the code in debug mode it runs successfully,but when i run the same code in release mode it mostly create error like …

Member Avatar for Ancient Dragon
0
191
Member Avatar for eescobar

I'm trying to write a program which locates a text file in "my documents," and reads and displays what is on the file. I'm using the 2005 version of C++ and I might be using the wrong format. Thank you.

Member Avatar for Ancient Dragon
0
97
Member Avatar for DeeIT

Please assist with creating a program using arrays and functions for student grades. These are the requirements: To create and execute a C++ program with functions and arrays that will read student information input from an input text file, calculate the test average, program average, course average, and the letter …

Member Avatar for John A
0
3K
Member Avatar for mknight

hello I am new to C++. I understand pointers and references a little and I must be missing something in conf.cpp. Would you help by pointing out my errors for my pointers coding errors related to my problem? Main reason I am asking is because I get a segment fault …

Member Avatar for iamthwee
0
151
Member Avatar for bala24

Hi all, I would like to know some links that could help me get a hang of using a database instead of the plain old file handling with C. Can somebody help !! Thanks

Member Avatar for bala24
0
98
Member Avatar for matrimforever

How do i use the function isspace to take sentences read into an array and make multiple spaces only one space between words? Use an if statement? if (isspace([I]aChar[/I]) ) cout << aChar; else ( Not sure what I need here.

Member Avatar for bala24
0
206
Member Avatar for ramzyel

[COLOR=#008000]:rolleyes: my program is not running right I,m not sure what is wrong with it the output is always true can someone help me[/COLOR] [COLOR=#008000]/// Robert H Ramzy IV[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <stdio.h>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <stdlib.h>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <conio.h>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <iostream>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <string>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <iomanip>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <ctype.h>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <cmath>[/COLOR] [COLOR=#0000ff]int[/COLOR][COLOR=#000000] number;[/COLOR] [COLOR=#0000ff]bool[/COLOR][COLOR=#000000] results ;[/COLOR] …

Member Avatar for Nick Evan
0
146
Member Avatar for JoBe

Hi, Got another question concerning an array of strings: I did it this way: [code] int main() { const std::string myArray[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; for (size_t i = 0; i < 12; i++) std::cout << myArray[i] << '\n'; std::cout …

Member Avatar for JoBe
0
606
Member Avatar for sciconf
Member Avatar for lcfoo
0
165
Member Avatar for JoBe

Hello ladies and gents, I just made the next exercise of this book and although it works as it should, [I]I was wondering if any of you guys could tell me whether or not it could be improved.[/I] The exercise goes as follows: - Define a table of the names …

Member Avatar for JoBe
-1
146
Member Avatar for marloni

<<Forked off from [URL="http://www.daniweb.com/techtalkforums/showthread.php?t=5516&page=1&highlight=tic+tac+toe"]this thread[/URL]>> I need a ticTacToe game code ..is there any body who wrote it before:( .

Member Avatar for ~s.o.s~
0
67
Member Avatar for dmmckelv
Member Avatar for zouyu1983
0
348
Member Avatar for TylerSBreton

I've been recently reading the forums a lot, seeing people throw around the phrase "pass-by-reference" in normal C. As far as I've been taught, C only provides pass-by-value. Now.....the developers of C came up with this genious idea of passing an address (which is still a value) through the parameters …

Member Avatar for mathematician
0
180
Member Avatar for mauricio_adamo

Hi everyone: I'm reading a file (line by line) but what I wanna do is to jump some lines, but I can't really figure out how to do that. I hope someone can help me out.

Member Avatar for mathematician
0
937
Member Avatar for pugg09

I'm still really green at this, but I've been working at this for 2 hours now and I'm stuck. Can someone help me? I'll post the code first, then the error underneath. thanks everyone! [code] #include <iostream> #include <vector> #include <string> #include <fstream> using namespace std; class Resource { public: …

Member Avatar for ~s.o.s~
0
182
Member Avatar for JoBe

Hello ladies and gents, Was wondering if any of you could check this exercise out, I finished it, but, I'm not sure whether Ive got it exactly right, especially the last two definitions. The exercise is as follows: - Use typedef to define the types unsigned char, const unsigned char, …

Member Avatar for JoBe
0
365
Member Avatar for sunny123

ive created this currency interest preogram which should calculate the interest depending on the currency amount entered. if 100 but less than 1000 then 1%, otherwise 3% for all other amounts. can someone give me any ideas as how to start the interest part of the program off, and which …

Member Avatar for ~s.o.s~
0
281
Member Avatar for NSta

This is just a brief question how would i read the attributes from the tokeniser in the same order as declaration occurs in the class declaration, separated by full-colons. Tokeniser class [CODE][COLOR=#0000ff] #include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<iostream> [/COLOR][COLOR=#0000ff]using[/COLOR][COLOR=#000000] [/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] std;[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]"Tokeniser.h" [/COLOR][COLOR=#0000ff]const[/COLOR][COLOR=#000000] [/COLOR][COLOR=#0000ff]int[/COLOR][COLOR=#000000] Tokeniser::THROW_EXCEPTION = 0;[/COLOR] [COLOR=#000000][/COLOR] Tokeniser::Tokeniser([COLOR=#0000ff]void[/COLOR]): _delim([COLOR=#800000]""[/COLOR]), _data([COLOR=#800000]""[/COLOR]), _currentPos(0), _throwException([COLOR=#0000ff]true[/COLOR]) …

Member Avatar for iamthwee
0
306
Member Avatar for aznballerlee

I have done the following, and I just want to check if I've done them all correctly: [LIST] [*]Declare a pointer variable named fp that can point to a variable of type string. [*]Declare fish to be a 5-element array of strings. [*]Make the fp variable point to the last …

Member Avatar for JRM
0
946

The End.