49,761 Topics
| |
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] | |
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: … | |
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. … | |
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 … | |
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? | |
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> … | |
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 … | |
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. | |
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 … | |
| 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 … |
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 … | |
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 … | |
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; … | |
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 … | |
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 … | |
: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 … | |
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. | |
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 … | |
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 … | |
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 | |
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. | |
[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] … | |
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 … | |
If I want to exit to Dos in a C program from a Switch statement, how do I do it? Thanks | |
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 … | |
<<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:( . | |
| Can anyone help me get started on converting a float to a fraction? |
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 … | |
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. | |
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: … |
The End.