49,756 Topics

Member Avatar for
Member Avatar for linq

if I have three words in there lines in a .txt file, and I want to read them to three string, how to do this using c++ ifstream? how to read every line(word)?

Member Avatar for WaltP
0
21K
Member Avatar for sbenware

My recent assignment is to find Mersenne Primes between 2 and 1,000,000. For the first part of my code, I have a function to find out if a number is prime or not. The second part of my program runs a Lucas-Lehmer test to find the Mersenne number. My problems …

Member Avatar for sbenware
0
311
Member Avatar for mattyd

(** This post was inspired by a recent post I read where a reply suggested the indenting of all code.) I am guilty of this, I'll be honest. I know it is important to indent and indent properly, it is industry standard, and it is simply utilitarian. I always think: …

Member Avatar for vegaseat
0
316
Member Avatar for hui

[code]#include <iostream.h> #include <fstream.h> main(int argc, char *argv[]) { //definition of the variables. int mtx1[20][20], mtx2[20][20], mtx3[20][20]; int n, i, j, k; //exit if the number of arguments is not 2. if(argc != 3) { cerr << "Usage: mm <filename1> <filename2>\n"; return 1; } //open the input file 1. exit …

Member Avatar for Salem
0
136
Member Avatar for Senekha

Hello, this is my first post on these forums. I'm taking a CPSC 100 course to supplement the science part of my degree, and I've been having a lot of trouble since the midterm, when the profs for the class switched (they have completely different teaching methods). Since then, I've …

Member Avatar for Senekha
0
587
Member Avatar for JS1988

Quick question, what do i want to put in the while of my do while statement in myprintitle function so that will loop around with the main part as well. [CODE] include<iostream> #include<iomanip> using namespace std; int startDay(int , int ); int calcjan1(int, int ); void printMonth (int , int …

Member Avatar for JS1988
0
127
Member Avatar for xerA

Hi everyone. I'm extremely new to this. It's my first programming course, period. I realize I probably needed a load of pre-reqs, but for some reason, I was advised to take Intro to C++ so... So far, I've been doing well! However, this latest project has me stumped... The jist …

Member Avatar for Ancient Dragon
0
106
Member Avatar for Juggler

I am once again getting confused with functions and arrays in C++. I am trying to write a program that collects three values from a user, then displays those and does various things with them. In short, what's the problem with this line of code right here? [code] player = …

Member Avatar for HelenHui
0
110
Member Avatar for mhasan_mitul

Hi Greeting to all I want to build a USB driver for windows98. But I do not know how to build a device driver in windows. My targeted language is C/C++. So I need help to know how can I build a device driver for windows. As well as I …

Member Avatar for Ancient Dragon
0
104
Member Avatar for mattyd

Greetings: A simple question that has me stuck: Program runs, calls function, function runs... Return to Main? This last area is where it fails. No errors, just no control returned to Main.cpp at end of function run. I've been studying the code much and researching the solution on the Net …

Member Avatar for mattyd
0
149
Member Avatar for JS1988

can anyone tell me how to fix this, it needs to print out the calendar for a whole year. [CODE]#include<iostream> #include<iomanip> int startDay(int year, int calcjan1); int calcjan1(int year); void printMonth (int startDay, int days); int main() { char again; int year=0; do { cout<<"Enter a year for a calendar …

Member Avatar for Nick Evan
0
110
Member Avatar for linq

I am using C++ in VC++ 2003 there are some examples like this [URL]http://www.codeproject.com/cpp/miniexcel.asp[/URL] but I don't quite understand. I hope someone could help me or guide me to some related documents, bow!

0
53
Member Avatar for RichC

I have been trying to store the values of card face value into an array called faceValue but I don't know how to do this. I've created the array and placed in public in my h.file (char faceValue[5];) but trying to link it to *face in the function deal is …

Member Avatar for Ancient Dragon
0
107
Member Avatar for noxee

Hi I'm trying to have an assignment operator for my linked list class so that when I call it, it replaces the current one with the one I pass in. i.e testList1 = testList2; I'm trying to get it so that testList1 will point to testList2. Here is the code …

Member Avatar for noxee
0
72
Member Avatar for FireSBurnsmuP

I had to use an enumerated data type in my last program, and I couldn't get my program to stop giving me fatal run-time errors. here is the enumerated data type: [code]enum piece {EMPTY, BLACK, WHITE};[/code] Now, the trouble I am having is related to evaluation or assignment of this …

Member Avatar for FireSBurnsmuP
0
151
Member Avatar for punter

Hey. The intent of this program is to help answer the question “How good is the random number generator rand()?”. The program must be designed and written in a modular fashion using functions and arrays The function rand() returns int values between 0 and some system-specified maximum value. The first …

Member Avatar for Ancient Dragon
0
221
Member Avatar for linq

I am using the MFC dialog application. There are 3 edit box, add1, add2 and sum and a button "add", when exectuing, I input add1, add2, and use the "add" function dlg.m_sum=dlg.m_add1+dlg.m_add2 how to make the sum appears in the "sum" edit box? Do I have to add a view …

Member Avatar for Ancient Dragon
0
107
Member Avatar for CurtisBridges

Nuts I'll be soon. I still cant get this to run.It keeps telling me cannot convert from const and I cant find where I declared a constant. Help Please! [CODE] #include <iostream> #include <iomanip> #include <conio.h> using namespace std; void call(void (*)); void Menu(char [11][25]); void Add(char [11][25]); void Update(char …

Member Avatar for Ancient Dragon
0
79
Member Avatar for JRM

Helo again. I was experimenting with the use of ctags in Vim. Before I started, I made sure to download the lastest and greatest version of "exuberent ctags. While the Vim manual says to run ctags *.c, i took the liberty to run ctags *.cpp instead (just in case...). The …

0
52
Member Avatar for batista06

Greetings...I'm trying to add a part for 2 times the rate for any hours over the first 60...Can anyone aid me? Many thanks [code] // This program calculates gross pay. #include <iostream> #include <iomanip> // Global constants const double PAY_RATE = 10; // Hourly pay rate const double BASE_HOURS = …

Member Avatar for Ancient Dragon
0
116
Member Avatar for coool_rahul

have prepared a code in c++ to save high scores and it is working well when i compile it in turbo c++and run the code . but when i exit from the turbo c++ , the file to which i saved the high scores get corrupted and so when i …

Member Avatar for Salem
0
747
Member Avatar for jimbobint

I'm really having trouble understanding how to initialize multidimensional arrays. The way it is explained in the book I'm reading is: You assign the list of values to array elements in order, with the last array subscript changing and each of the former ones holding steady. Therefore, if u have …

Member Avatar for ~s.o.s~
0
147
Member Avatar for noxee

I'm having a problem inserting data into my binary search tree, it will insert some of it but not all. this is the header file for my BST class: [code=c++] #ifndef BST_H #define BST_H //----------------------------------------------------------------------------------------- #include <string> #include "LinkedList.h" //----------------------------------------------------------------------------------------- using namespace std; //----------------------------------------------------------------------------------------- class BST { public: //Default constructor, …

Member Avatar for noxee
0
124
Member Avatar for jcflore3

Five sets of 3 double numbers stored in a 5x3 array in C++, How do i do this, I have this so far [COLOR=#0000ff]include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<iostream> [/COLOR][COLOR=#0000ff]# include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<iomanip> [/COLOR][COLOR=#0000ff]# include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<cstring> [/COLOR][COLOR=#0000ff]# include[/COLOR][COLOR=#000000] [/COLOR][COLOR=#800000]<cstdlib> [/COLOR][COLOR=#0000ff]using[/COLOR][COLOR=#000000] [/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] std;[/COLOR] [COLOR=#0000ff]int[/COLOR][COLOR=#000000] main ()[/COLOR] { [COLOR=#0000ff]const[/COLOR] [COLOR=#0000ff]int[/COLOR] NUMROWS = 5; [COLOR=#0000ff]const[/COLOR] [COLOR=#0000ff]int[/COLOR] NUMCOLS = …

Member Avatar for may4life
0
210
Member Avatar for The Leprechaun

ok well i started out with making my own source code then compiling and running with Dev-C++ and when i run it, its working fine until the last line, here let me past my code [code]// just a test #include <iostream> #include <string> using namespace std; int main () { …

Member Avatar for may4life
0
80
Member Avatar for Jonezy

Ok I'm back with another problem im having.. I have a vector of casual staffmembers.. Each time i create a casual staffmember they are added into a vector named thecasuals.. To return a casual staffmembers staffID a function is created: [code=c] staffmember::get_staffid(); [/code] I need to be able to enter …

Member Avatar for Jonezy
0
100
Member Avatar for Schmitty27

Hello, I've been working on this problem for a while, its a program that needs to convert military time to civilian time from an input file using a user-defined function. Then the program must find the maximum temperature and list the temperature and the time at which it occurs. My …

Member Avatar for Schmitty27
0
140
Member Avatar for JS1988

I really appreciated your replys, it helps me a lot when i can see how it is done they way you did it.It really helped me with my other ones I was working out. Do you know how to write a program to print out the calendar for a whole …

Member Avatar for John A
0
115
Member Avatar for Nekokoneko

Hello, I am currently in a programming Logic and design course at my local community college and I was give 5 chapters to read because I join the class late. I am now in 3 and I am confuse with a method that the book does not explain too much. …

Member Avatar for John A
0
98
Member Avatar for mattyd

I am planning to implement [I]#include <time.h>[/I] in my program. I have never yet used this include. I will be using this in order to track a 24-hour period, or at least that is what I wish to do; I basically need to set up a natural 24-hour day that …

Member Avatar for WolfPack
0
113

The End.