2,025 Topics
![]() | |
I am having problems with the new operator() specifically within std::string I appear to have hit a memory limit in visual studio. Ideally I would like someone to help me find one of the following solutions: 1 - Can I access the memory in a very big file directly without … | |
Hello guys, that's my first post around here and I have a problem with binary files. I'm writing a simple editor for my arkanoid clone game. This editor opens a binary file defined by this: 0-26 byte: Descriptor for the file. Once in each file. 27->(1141*n): Levels inside the file, … | |
Hey guys I need help with a program for school. It involves a menu to access sub programs and use of recursive techniques as well as 2D arrays and traversing. Here's the requirements: In this program, you are to create a menu-driven program that allows the user to execute one … | |
I'm still working on the same problem. Im doing a text-twist code for c++ as part of our school requirement. Last time, I'm having problems on delaying outputs using CLOCKS_PER_SEC and clock(), but thanks to some people, I solved that problem already. Now, Im working on the game's play mode. … | |
hey everyone, I got a weird error when I run my program. I compile and link and run the program through the terminal in Ubuntu. I have to compile or linking errors, and the program run's fine, except when the program asks: "Would you like to see a display of … | |
I want to read characters(256 of them) from a file and put thier numeric value in an array.Then i want to send 16 characters in batches from the array onto a loop in successive steps to perform operations on them. My problem: First i can read the first batch of … | |
hello all I am a second semester c++ college kid so bear with me I am writing a program that takes in bank account info, sorts it, prints it, and then prompts the user if they would like to view any specific records via the account number or the name … | |
Hello, I'm new here but I need a little help please. I've gotten this program to mostly work correctly except for what seems like one small detail. My program is supposed to ask the user to enter a file name, open it and display its contents 24 lines at a … | |
Hey everyone, I have this assignment for my C++ class and I need to sort some data I have data in a file in this order: some 10 digit int -the account id some name -the account name some balance -the account balance basically I want to sort the data … | |
Hello everyone, I am a C++ newbie and I am running into some linking errors. I am using Vi to compile and link my code. Here are the linking errors: assign6.o: In function `cAccountList::cAccountList()': assign6.cpp:(.text+0x1db): undefined reference to `cAccount::cAccount()' assign6.o: In function `cAccountList::cAccountList()': assign6.cpp:(.text+0x22b): undefined reference to `cAccount::cAccount()' assign6.o: In … | |
Hey everyone I am writing some code for my c++ class and in this program I am trying to sort back account information by there accountID #'s. When I try to compile, here are the errors I get: assign6.cpp: In member function ‘void cAccountList::sort_by_ID()’: assign6.cpp:110: error: ‘accountID’ was not declared … | |
This is probably a really easy question, and I know it's starring at me right in the face, but I can't put my finger on it. I'm doing this semi-simple program for school and I think my only problem here is passing my array of structs to a function that … | |
hey everyone, so im trying hard to get this assignment done by tomorrow but after sucessfully compiling, I am now getting linker errors. I have to use Vi for this assignment but never the less here are my linker errors: assign5.o: In function `main': assign5.cpp:(.text+0x1026): undefined reference to `Print(cStudent (&) … | |
Hey everyone, I am writing a program for my c++ class to take student records and organize them according to the students last name. All data is stored to a class and I have created an array of class objects(its part of the assignment). I am using Vi to compile … | |
Hey all! I have this assignment for my school project to create a simple address book using classes that do the routine stuff like adding a contact, searching it, modifying it, deleting it... Here is the code but it won't run properly. I tried but couldn't figure it out. It'd … | |
Hello all I am trying to link a program using Vi for my class assignment and I am getting the following error in Vi when I try to link: Assign4.o: In function `__static_initialization_and_destruction_0(int, int)': Assign4.cpp:(.text+0x17b): undefined reference to `cCourselist::cCourselist()' collect2: ld returned 1 exit status Here is my source code: … | |
Hello all Im back with another crazy assignment from my professor and I'm running into the following debugging errors in Vi (we have to use it) so here are the errors: Assign4.cpp: In member function âvoid cCourselist::Load(Infile_t&)â: Assign4.cpp:105: error: expected unqualified-id before â[â token Assign4.cpp:109: error: expected unqualified-id before â[â … | |
I want get data from the car1.txt file and do the probability calculation but all result is 0.0% ?? just want to ask how to get large number of data from txt file by using array method. This is my txt file and cpp file [CODE]1 1 2 2 3 … | |
Can someone help em out with this: Im suppose to do this: [URL="http://www.ise.ufl.edu/cgs2421/cpp/files/projects/pro2.pdf"]http://www.ise.ufl.edu/cgs2421/cpp/files/projects/pro2.pdf[/URL] I gotta use loops to solve the horner algorythm This is whta i have but is not working [CODE]#include <iostream> using namespace std; int main (void) {// VARIABLE DECLARATIONS: double choice; // EXECUTABLE CODE: cout << "CGS … | |
I have made a minor program. My program doesn't modify and I want to add a person at begining with emergency function. please help me out where i m lacking.[code] #include<iostream.h> #include<conio.h> #include<fstream.h> #include<ctype.h> #include<string.h> #include<stdio.h> class hospital { char name[20]; int age; int i; public: hospital() { i = … | |
I have created a completely new new Windows Form application and are trying to add this namespace: [code] #include "stdafx.h" #include <ctime> #include <iomanip> #include <iostream> #include <fstream> #include <sstream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <limits> #include <ios> #include <cstdio> #include <numeric> #include <cstdlib> #include <ctype.h> … | |
Hey everyone I'm a college student taking semester two of C++ and we have a project using classes. This semester we are strictly using Vi to edit and compile my code. WARNING THIS CODE IS NOT THE WAY I WOULD PERSONALY WRITE IT, BUT MY INSTRUCTOR INSISTS ON THIS FORMAT. … | |
Hello all I am a second year C++ student in college and I am running into some issues with a code assignment I am writing. *Note: I realize that there may be better ways of doing the code but I am following my instructors guidelines so please no posts about … | |
Hello I'm trying to read the ID3 tag from a file. For now, I print out the string that I've read and I can see the title, year and so on but in the specs it says that the first 7 bytes contain ID3, the version, some flags and the … | |
hey guys im using vi to try and compile code for school in main i keep getting errors in the functions READ and PRINT and they say that the variable in the function call is not within the scope. here is my code: [code] #include <iostream> #include <iomanip> #include <fstream> … | |
Please help, and point me in the write direction... okay so I'm basically doing a simple address book. i can create contacts and display them and search for them but... when i return to the main menu and attempt to search again... i cannot open the file... or if i … | |
[CODE] #include <iostream> #include <cstdlib> #include <ctime> #include <cstring> using namespace std; struct UKStudent { char name [30]; int noTest; float mark [10]; int final; char grade [30]; }; struct OverseasStudent { char country [30]; char name [30]; int noTest; float mark [10]; int final; char grade [30]; }; union … | |
Hi I am trying to make a nursery registration form for an assignment at uni and have hit a stumbling block. I have written the functions but dont really know what to declare them as. Could anyone help. [CODE]#include <cstdlib> #include <iostream> #include <fstream> using namespace std; int menu(); //creating … | |
I am doing a program to get a sample infile.txt & ouput to outfile.txt I encountered alot of probs which I can't solve now. I am having issues reading from infile.txt & display the correct result in outfile.txt Pls enlighten me further. The program have to submit this Tue. My … | |
hey xpert i'm class 12 cbse student...unfortunately i'm not able to get the output from my project. the project is based on bank employee detail.........i'm gettin the output ,but the thin is xcept aading records of the employee i'm not able to do other operation like modifiaction,deletion,listing...!!!!!!! your will be … | |
[code] #include <iostream> #include <fstream> #include <cstdlib> // to clear the screen #include <cmath> #include <string> using namespace std; #ifndef NULL #define NULL 0 #endif int MAX_FLOOR=10; struct passenger { int id,waitingtime,timestamp; float source,destination; passenger * next; }; struct node /*this is the linked list that contains source and destination … | |
Can someone help me create a function to print all items with a Prod_Stockcount less than 5? Its missing some code but all you need is to add and then create a function to print items with stockcount less than 5 [CODE]# include <stdio.h> # include <string.h> # include <iostream> … | |
[CODE]#include <iostream> #include <windows.h> #include <fstream> #include <string> #include <ctime> #include <vector> using namespace std; bool fileCheck(const char *filename) { ifstream ifile("item.txt"); return ifile; } int show(int p) { srand( time(NULL) ); int random_integer; random_integer = ( rand ( ) % p ) + 1; return random_integer; } int main … | |
![]() | Hello, I am making a console application for a window home computer. The application will search for factors of a number that the user enters. Everything works fine up to about [10^10 = 10000000000]. I am unsure if C++ has a maxium number allowence. If this is the case can … |
Hello Helper, This is my code. I want to compress the file encrypted and then decrypt the same original file.Can you help ? /* [CODE]#include<iostream.h> #include<conio.h> #include<fstream.h> #include<stdio.h> #define ENCRYPTION_FORMULA (int)Byte+25 #define DECRYPTION_FORMULA (int)Byte-25 int Encrypt(char *FILENAME,char *NEW_FILENAME) { ifstream fin; ofstream fout; char Byte; char NewByte; fin.open(FILENAME,ios::in,ios::binary); fout.open(NEW_FILENAME,ios::out,ios::binary); if(!fin) … | |
Hello. I have a program that reads from file, modifies its content and saves. But there's a problem - when i write only one block of data, two of them are been written! [CODE]class person { ... }; ... person User; fstream File; File.open("file.dtb", ios::in|ios::out|ios::binary); // Adding 1 record: File.seekp(number, … | |
Hai, This is a source code written in turbo c for car racing game as a part of my higher secondary project. May I get some advices to improve it? 1.Did I use the real method to constitute motion in c? 2.How can I include sound in c? { Function … | |
Today is my second day with *<Accerlerated C++>,* and so far I've read until chapter three. Below is the code written in the book and as a part of solving the chapter's exercise problem 3-0, I typed and compiled the code. (using vc++ 6.0) I assumed there would be no … | |
how do i get a function to write to a file for me?? im getting the error error: invalid use of void expression i want to save my tic tac game board to this file in order to save it..... am i going the right way about it?? [code] if(save_or_not … | |
Hey everyone, I'm new to posting in these forums so sorry if I didn't post my code correctly? I think i did it...hopefully. Anyways, I've been working on this all day but I can't figure it out. (i think i will be having problems with the rest of my assignments … | |
Hey, I have a file of RGB values, seperated by : just so they count as a single line. I'm importing these into a string vector and sorting these so they come out sorted from 0:0:0 to 99:99:99. [CODE] vector<string> sV; ifstream in("Images\\Stage1RBGList.txt", std::ios::binary); string word; cout << "Starting Compression..." … | |
I have created a procedure, exitFailure() that is invoked if a file doesn't exist: [CODE] int exitFailure() {//start exitFailure() printf("Failure, hit any key to exit and press enter.\n"); scanf("%d", &counterx); return 1; }//end exitFailure() [/CODE] Below is the snippit of code that invokes exitFailure() [CODE] inFile.open(inputFilename, ios::in); if (!inFile) { … | |
Hello. I have created a simple program which generates 3 random numbers, puts them in a text file, reads them, and then does 3 small calculations, results are put in another text file. Program is working correctly on my PC, however there is a catch. I need to submit it … | |
I have written a function which will open the file with the input name provided.I am compiling on a Linux box using g++ compiler.Detail code below Plz let me know what is the wrong in code. [CODE]1 #include<iostream> 2 #include<fstream> 3 #include<string> 4 #include<stddef.h> 5 #include<cstddef> 6 #include<cstring> 7 8 … | |
I think the pieces, taken separately, are okay, but they don't seem to play together well. [CODE] //lab12: This program requests input of ten employee names and salaries; //a file is created and they are written into it, and the file is closed. //The file is then reopened and the … | |
Hi, I have this annoying problem in my project program.It simulates a Library.From the data stored in a binary file,the information about books are to be displated as: [U] Sl.no Book code Book Name Author no. of books[/U] 1 ES101 Sherlock.. A.C Doyle 10 2. SF200 Harry Potter J K … | |
Hi, I'm reading a line from a text_file.txt The line looks like: 1#Jonh#Smith#PO Box#4.9#5.0# The code being used: [CODE] fstream file; file.open("Tbl_cliente.txt", ios::in); // open a file for input file.unsetf(ios::skipws); getline(file, Cli_nombre, '#'); getline(file, Cli_apellido, '#'); getline(file, Cli_dirr, '#'); file >> Cli_total_compras; file >> Cli_balance;[/CODE] But when I look for … | |
i think this part got problem..anyone can guide me? [CODE]ifstream BanKing; BanKing.open("BankData.txt"); while (!BanKing.eof()) { BanKing>>loginName; BanKing>>password; if(loginName == loginName1 && password == password1) { menu(); break; } else { cout<<"\tUnregistered ID or you have enter a wrong password !"<<endl; cin.clear(); cin.ignore(); getchar(); return ; } BanKing.close(); } }[/CODE] i … | |
Can anyone guide me how to solve for the login problem..i think is the read file problem.. I try many ways but can't. here the code: [CODE]#include <iostream> #include <string> #include <fstream> #include <cstdlib> #include <cmath> #include <windows.h> using namespace std; class bankAccount { private: string name, loginName,loginName1; float IDnum; … | |
Hi, I am working on a program, it asks user for a file name and opens that file with that name, do some calculations and create a new file with the filename.output (.output is the extension) and save the contents into it. I have been working on it for a … |
The End.