2,025 Topics

Member Avatar for
Member Avatar for smeghead007

My problem is that when i run the program i ask the user to select a month from a menu then input a year. I then calulate the first day and janaury for that year. Then i have to find the first day of the month the user selected but …

Member Avatar for smeghead007
0
142
Member Avatar for ParadoxKing

Hello, I am writing a program that does matrix Multiplication using 2-dimensional arrays and a Matrix Class. The program compiles without any errors but when I get to the part of the program where it actually multiplies the 2 matrices it throws an exception. I've looked through the code several …

Member Avatar for Salem
0
413
Member Avatar for emilo35

Okay, this might become a monstous post, and I apologize for that. I recently switched from programming Java to C++ like a week ago, and can't seem to get all the pointers right it seems. Maybe all code provided in this post might seem a little overkill for the size …

Member Avatar for emilo35
0
186
Member Avatar for GSPprog

Hi I am trying to get this program to work to insert a node into the list and move the list down so the node will fit. I get the node to be inserted into the right place but the list is copied as such. if 1. joe 2. linda …

Member Avatar for Ancient Dragon
0
103
Member Avatar for atticusr5

Hey everyone, I am trying to get my school program on pointer variable linked lists to work, but I have incountered a runtime error. When I try to print my data to the screen or a file, it does not work. I am not sure if my program is not …

Member Avatar for tetron
0
89
Member Avatar for aLLtIMElOW

HOW can i solve this program?..Write the definitions of the declared function prototypes of the given code. This program should be able to simulate ATM functionalities. For simplicity sake, this ATM can only handle one account and the initial balance will always have the same value every time the program …

Member Avatar for Salem
-2
146
Member Avatar for atticusr5

Hey everyone, I am using Visual Studio 2008 to debug some code where the goal is create a linked list using pointer variables. Here is the main error I am getting when trying to compile: [CODE] error C2227: left of '->Account' must point to class/struct/union/generic type type is 'Link_t' [/CODE] …

Member Avatar for atticusr5
0
141
Member Avatar for windany

This code : ...line 6... [code] #include "FileToVector.h" #include "VectorToIntArray.h" #include <string.h> #include <iostream> using namespace std; int main(int argc, char *argv[]){ char* in = argv[1]; FileToVector ftv = FileToVector(in); vector<char> v = ftv.fileToVector(); VectorToIntArray vt = VectorToIntArray(v); //int* a = vt.letterFrequencies(); cout<< v.size(); return 0; } [/code] produces this …

Member Avatar for windany
0
103
Member Avatar for sikeufoo

The highlighted part below is where the function located...Is there any problem with the input? [CODE]#include <iostream> #include <iomanip> using namespace std; // function declaration for price to pay. [COLOR="Red"]float caldiscountprice(float[],int[],float[]); [/COLOR] // function declaration for discounted price. [COLOR="Red"]float calpriceafterdiscount(float[],int[],float[]); [/COLOR]//function declaration for Price after Discount int main() { int …

Member Avatar for WaltP
0
127
Member Avatar for sikeufoo

I am a newbie to c++... Today I was handed a assignment on "array"...While working on this...I've met plenty of errors... I wonder where did my steps gone wrong... May anyone out there borrow me a helping hand?? [CODE]#include <iostream> #include <iomanip> using namespace std; float calpricetopay(int[5],float[5]); // function declaration …

Member Avatar for sikeufoo
0
109
Member Avatar for richman0829

This seems simple, but it's not working. There IS a text file in the same directory, but it's not being opened (and with the ios::in | ios::out, it should open even if it doesn't exist). I also ran into trouble trying to use infile.fail, which is why I used !infile. …

Member Avatar for richman0829
0
159
Member Avatar for techie1991

Hello, I was trying to implement data structures using file operations. I am using a data structure of two integers, one being the index number and other being the value. My actual aim is to recreate the file containing the data using a log. But, the program isn't running as …

Member Avatar for WaltP
0
482
Member Avatar for smeghead007

Ok what im tryin to do is open a file by the name a user request after that i ask the user and id number to look for in the file if its found i want to display it along with the name after it but i cant figure out …

Member Avatar for WaltP
0
105
Member Avatar for missmedude

I just did this and I am not sure I am doing this correctly. You have purchased a stereo system that cost $1000 on the following credit plan: no payment down, an interest of 18% per year, and monthly payments of $50. The monthly payment of $50 is used to …

Member Avatar for Robert1995
0
114
Member Avatar for 'AnKo

Hello all! This is my first post to community! I've been writing a program in C++ (not MFC) to get a NTFS ADS file and copy it to desktop. If you don't know what ADS file is, you don't really have to matter, let's say that this program must just …

Member Avatar for 'AnKo
0
325
Member Avatar for GSPprog

I am trying to get a program that gets a list from a txt files outputs it. then inserts a node into the list and the list grows dynamically. Everytime I insert into the list the list is filled with the same values following the insertion point. For this example …

Member Avatar for GSPprog
0
270
Member Avatar for vbx_wx

[CODE] sendfile(string path) { int length; char buffer[10]; ifstream in(path.c_str() , ios::binary); in.seekg(0 , ios::end); length = in.tellg(); in.seekg(0 , ios::beg); stringstream infofile; string name = splitname(path); infofile <<"info" << " " << name << " " << length; string infoBuffer = infofile.str(); send(infoBuffer); while(!in.read(buffer , 1).eof()) { cout <<::send(sock …

Member Avatar for gashtio
0
125
Member Avatar for dnalor

[code=cplusplus]#include <iostream> #include <conio.h> #include <iomanip> #include <fstream> using namespace std; const int numStudents = 5, numQuiz = 10, numAssign = 10, numFinal = 1; const int totalGrades = 21; void computeStudAver(const int grade[][numQuiz], double stAve[]); void computeQuizAver(const int grade[][numQuiz], double quizAve[]); void printall(const int grade[][numQuiz]); int menu(); int main(); …

Member Avatar for brillantes
0
87
Member Avatar for rockstar8577

For some reason i cant output to a file unless it was already created. Here's my code. [code] fstream myfile; myfile.open (filename.c_str(), ios_base::in); if (!myfile) { myfile.close(); myfile.open (filename.c_str(), ios::out); avatar.name = name; avatar.init(); myfile << "Name = " << avatar.name << endl; myfile << "hp = " << avatar.hp …

Member Avatar for rockstar8577
0
118
Member Avatar for AJW

hello all, I'm taking a C++ class at my local community college. A project that was assigned was to make a menu program. I am about 90% done (I think), when I ran into this issue: when making a selection, the program doesn't know how to handle decimal numbers. The …

Member Avatar for AJW
0
110
Member Avatar for jigglymig1

i have to write a program that will read in a txt file that also has periods, exclamations, question marks and <CR>(returns). and do some other stuff. right now i am having trouble with comparing the words..... this is at the very bottom of my code [CODE]#include <iostream> #include <fstream> …

Member Avatar for mrnutty
0
84
Member Avatar for clutchkiller

[code] void encrypt::transform() { int length = 0; char *buffer; char ch = ' '; int i = 0; fileEncrypt.open("filter.txt", ios::in | ios::beg); fileEncrypt.seekg(0, ios::end); length = fileEncrypt.tellg(); fileEncrypt.seekg(0, ios::beg); buffer = new char [length]; fileEncrypt >> ch; while(!fileEncrypt.eof()) { buffer[i] = ch; i++; fileEncrypt >> ch; } for(int j …

Member Avatar for jonsca
0
103
Member Avatar for atticusr5

Hey Everyone, I am trying to compile and run a program for my C++ class, and I am getting a Segmentation Fault as a runtime error. I looked at my code and my datafile to make sure that there was not an issue but I can not seem to find …

Member Avatar for atticusr5
0
180
Member Avatar for rockstar8577

I was wondering if its possible to specify the name of a file being created with a variable yet still specify the extension for the file. Example: [code] string name; cin >> name; ofstream myfile; myfile.open(name".sta", ios::out); [/code] i was wondering if you could do something of the sort i …

Member Avatar for rockstar8577
1
73
Member Avatar for vidit_X

Question by ~s.o.s~ Write a program which will perform the job of moving the file from one location to another. The source and destination path will be entered by the user. Perform the required error checking and handle the exceptions accordingly. (Intermediate) [code=c++]#include<fstream> #include<iostream> #include<cstdio> using namespace std; int main(){ …

Member Avatar for mrnutty
0
381
Member Avatar for indigo.8

Hi guys having a single problem with some code. The program is statically linked to another which is suppose to take an input from a text file into an array; and then return a pointer to the array to the main program. The text file contains 10 ints one per …

Member Avatar for indigo.8
0
114
Member Avatar for dchunt

My text file contents are in the form "00101010111101101011". I want to read it from the file and send each digit to an array,unfortunately i'm only able to use char while reading a file.How do i send each digit onto an array?a [code] #include <iostream> #include <iomanip> #include <fstream> #include …

Member Avatar for WaltP
0
116
Member Avatar for isralruval

i have the following function which works, its encrypts a text file, well its suppose to shift the letters of a text file by whatever the user wants, lets say the text file says "zoo" if the user wants to shift the letters by 1 to the right the output …

Member Avatar for NathanOliver
0
86
Member Avatar for rahul8590

Well ,it may sound a bit preposterous , but i have a pretty weird problem (which i have solved many times , dunno why it isnt working for me this time ) . I have a data file from which i randomly pick up row nos . The data file …

Member Avatar for WaltP
0
201
Member Avatar for isralruval

i have the following function which works, its encrypts a text file, well its suppose to shift the letters of a text file by whatever the user wants, lets say the text file says "zoo" if the user wants to shift the letters by 1 to the right the output …

0
71
Member Avatar for mrinal.s2008

Hi, In the code snippet below, I tried to write the contents of a vector to a file using ostream iterator. However, when I try to read the contents of the file using istream_iterator, there is a problem. When the istream_iterator object is initialized using ifstream object fin, the istream_iterator …

Member Avatar for mitrmkar
0
300
Member Avatar for isralruval

i have the following code which works, well its suppose to shift the letters of a text file by whatever the user wants, lets say the text file says "hi" if the user wants to shift the letters by 1 to the right it will become "ij" ok but the …

Member Avatar for Salem
0
131
Member Avatar for atticusr5

hey everyone so for my class in c++ we were asked to implement a linked list in an old program. in the old code i had two classes, and the point of the new code was to take the old code and implement a linked list. I honestly have no …

0
52
Member Avatar for tom384

Hi folks, First a bit of context (Errors are shown at the bottom of the post): I am creating an object viewer for opengl in Visual C++ 2008 Express Edition. I have written a parser which reads the file and stores all the info I want in a Mesh object. …

Member Avatar for tom384
0
358
Member Avatar for atticusr5

Hey everyone, I have to take some code and make my a linked list using the accounts class. would i simply have to replace the list class with a struct???? here is my code.... [CODE]//Assignment #6 due 2-8-2010 #include <iostream> #include <iomanip> #include <fstream> using namespace std; //global declarations typedef …

Member Avatar for Ancient Dragon
0
77
Member Avatar for pinsickle

I have << overloaded to write to a file, however I get an error when I try to use it in main. I tried calling the actual write method. Is the SpareTable that operator that is failing. I already checked the .h and .cpp parameters and that all my #includes …

Member Avatar for jonsca
0
163
Member Avatar for newcuser

Hello, I am attempting to rewrite a program in c. Here is what I have so far. Thanks in advance for assistance. [CODE]#include <stdio.h> void sales[ salesPerson ][ product ] += value; int main() { const int PEOPLE = 5, PRODUCTS = 6; double sales[ PEOPLE ][ PRODUCTS ] = …

Member Avatar for mitrmkar
0
183
Member Avatar for terabithia

Hi.. I suppose to have a programe to read a data from a file and enqueu it to the Queue. The programme works like a Priority queue whether the ladies queue need to be inserted to queue first before the gentleman... But i think i need to try first how …

Member Avatar for scott.vass
0
3K
Member Avatar for rmrgrs

All might gurus of that which I don't understand- I am a student and I am asking for some homework help (sorry, I am really stuck). I am getting a "C4430: missing type specifier - int assumed. Note: C++ does not support default-int" error, and for the life of me, …

Member Avatar for rmrgrs
0
84
Member Avatar for Metraton

Hello guys! I'm facing a problem with IO using files. Here is the simple code that's kepping me awake: [code]Files::Files() { numbers.open("textfile.txt"); if ( numbers.good() ) { cout << "Object from Files class ok!" << endl; } else { cout << "Object from Files class NOT ok!" << endl; } …

Member Avatar for jonsca
-1
79
Member Avatar for spetsnaz26

I've got this annoying "access violation" problem. I've done searching for a whole day on the Internet and although I didn't find any solution specific to my problem I do understand "unhandled exception in abc.exe:0xC0000005: Access Violation" has something to do with inappropriate use of pointers. However where the error …

Member Avatar for spetsnaz26
0
1K
Member Avatar for clutchkiller

This is an assignment for my c++ class im taking. [code] #include <iostream> #include <fstream> using namespace std; const int NAMESIZE = 50, DATE = 25; struct inven { char name[NAMESIZE]; int qnty; double wholeCost; double retailCost; char date[DATE]; }; void displayMenu(); void addRecord(fstream &); void displayRecord(fstream &); void modifyRecord(fstream …

Member Avatar for clutchkiller
0
187
Member Avatar for jdpjtp910

I have a program that is menu driven by functions. The program gathers inventory data from the user and then the user can add, change, display (by record #), or display all records. The code works great, BUT when I add records and go to edit them, it changes the …

Member Avatar for mitrmkar
0
125
Member Avatar for timbomo

[CODE]I cant get this to read these numbers correctly 11.95f, SQFT2 = 12.35f, SQFT3 = 13.28f, PI = 3.14159f, when i run it , the answer comes out to be a whole number 11.[/CODE] i also need help on the do while loop i almost got it but i ended …

Member Avatar for WaltP
0
85
Member Avatar for jdpjtp910

I have a program for school. The program is an inventory program. It will start by writing blank records to a file. The user then should have a case drive menu. The user will select an option for what action they desire. Actions are add new record, change record, and …

Member Avatar for dusktreader
0
2K
Member Avatar for timbomo

ok how will i keep track of the items i bought? i have not the slightest clue on that. i dont even know where to start. can someone point me in the right direction? [CODE]#include<iostream> using namespace std; int main() { char symb; int item_purch, numb_item_purch, quit,; double mug = …

Member Avatar for Lerner
0
169
Member Avatar for timbomo

How would i keep track of money spent? and items bought when i loop and how do i say i want multiple items meaning if i want to purchase more than one teeshirt or mug. /* SIUE's bookstore is having aspecail sale on tiems embossed with the cougar logo. For …

Member Avatar for timbomo
0
117
Member Avatar for ppotter3

Hello, I am working on a program that takes an integer array filled from a random number generator. These values are suppose to be from -5000 to 5000, 2500 of them. Then I want to find the standard deviation of the numbers in the array. I am required to use …

Member Avatar for ppotter3
0
1K
Member Avatar for timbomo

How can i make this into a menu where you select a letter and you get a response that reads you have choosen "a" which is $2.50 /* SIUE's bookstore is having aspecail sale on tiems embossed with the cougar logo. For a limited time, three items, mugs, teeshirts, and …

Member Avatar for Lerner
0
109
Member Avatar for anthony5557

I wonder if anyone can help me. I'm suppose to write a program to ask the user to enter the file they want to display and display the file they want 24 lines at a time. It pauses at 24 and asks them to press enter and displays the next …

Member Avatar for WaltP
0
103

The End.