49,761 Topics

Member Avatar for
Member Avatar for matrimforever

How do I read data such as song titles from a file and store them in an array? I have: [code] const int SIZE = 50; int main() { char theFile[SIZE]; cout << "Please enter a file name: " << endl; cin.getline(theFile, SIZE); ifstream theFile(" "); ... [/code]

Member Avatar for Ancient Dragon
0
134
Member Avatar for jcflore3

Hi, you guys helped me on a program about a month ago and it really helped me get through the program. Therefore I really appreciate what you all do and thank you for the help last time I am having trouble finishing this program on classes the assignment is this: …

Member Avatar for may4life
0
228
Member Avatar for insamd

G'Day guys, Being working on some code, and was just wondering if there are any obvious places i have gone wrong. I am trying to make 2 functions, 1 that will find the factors of a given number, and the other function to find the percentage of the even factors. …

Member Avatar for John A
0
95
Member Avatar for aznballerlee

I've read my book, and there's some topics where I feel weak about: - inline functions - static members - this pointer - copy constructor I've read some tutorials online, but they use some complicated code, and I'm a beginner programmer, so I can't understand their explanations. Just wondering, if …

Member Avatar for oRg
0
153
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
115
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
169
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
153
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
147
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
608
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
353
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
938
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
185

The End.