2,025 Topics
![]() | |
Hi. I am just wondering how to restore a number that is in scientific notation. So, take a number that is in scientific notation, turn it into standard form, and resave the variable in standard form. here is an example of outputing the variable amount in standard form: [CODE]n1.setf(ios::fixed); cout … | |
the uploaded is a assignment and i want to solve this task using the library fstream and using the tellp ,seekg other functions also can some body help me in that how to use all these things..!!I WROTE A FUNCTION ALSO BUT IT IS NOT READING THE FILE??? THE FUNCTION … | |
Hello, I do not understand the following parts in bold - how it works, what is is for..etc. I'm not following the book's explanation.. [CODE]#include <iostream> using namespace std; [B] double totalCost(int numberParameter, double priceParameter);[/B] int main( ) { double price, bill; int number; cout << "Enter the number of … | |
In working on a logfile for an application, I needed to limit the size of the logfile to 1000 bytes. Since it is not possible to delete lines from a file in C++, I used the following steps: Rename the logfile to a temporary name. Read the temporary file. Write … | |
Hello I appreciate the time you are taking to read my thread! I have a background in real estate development and no programming experience. I already have a bachelors in Business (emphasis Finance). I am currently getting my MBA in an evening program at one of the top 20 schools … | |
Basically I dont even know if I named the thread properly but lets get on the story. I've got a list of wares (in text file) with its name, date it was brought to store, date it was sold, amount and price. [CODE]Pigema //name date it was brought sold amount … | |
Hi! I am writing programm that will determine what number is drawn in bmp image (there is only one digit number in image). So, I am trying realize it the following way: 1. read image pixel by pixel 2. create a two dimentional array of pixel values 3. if color … | |
I'm trying to make a cllient-server chat that only needs to be able to handle 1 connection. First, I have a data-type question: 1. At the moment I am using this code to get messages [CODE] BufferedReader ins = new BufferedReader(new InputStreamReader(sock.getInputStream()));[/CODE] And this code to send messages [CODE] PrintStream … | |
Hi there, I'm looking for a Cross-Platform to build [B]native[/B] mobile apps. It should meet the following requirements: - It should support these OS: iOS, Windows Mobile, Android - I'm [B]NOT[/B] looking for frameworks to build [B]WEB[/B] apps using HTML, JS, and so on. The wanted platform/tool/framework should use a … ![]() | |
I found a client/server code and I am getting this error: [QUOTE]java.net.SocketException: Software caused connection abort: recv failed[/QUOTE] Server code: [CODE] import java.net.*; import java.lang.*; import java.io.*; public class Server{ //port number should be more than 1024 public static final int PORT = 1025; public static void main( String args[]) … | |
You are the owner of a hardware store and need to keep an inventory that can tell you what different tools you have, how many of each you have on hand and the cost of each one. Write a program that initializes the random-access file hardware.dat to 100 empty records, … | |
I'm trying to make a camera app using AVCaptureSession. For now I just want to see if the video input works or not. But it looks like there is no input and I can't seem to understand why. - (void)viewDidLoad { [super viewDidLoad]; session = [[AVCaptureSession alloc] init]; [self addVideoPreviewLayer]; … | |
Apple's latest version Beta iOS 5 mobile OS and one of the ... That includes home screen, multitasking, adjusting the device volume. ... In future, apple has planned to replace assistive touch in place of hardware button. | |
having issues with my program running propperly. I think i have it right but i need a more skilled eye to take a look at it for me and set me in right direction. the code will complie, but everything i enter comes up invalid when some of it should … | |
Hello! On Android if the application which runs can not get permissions (even if user wants) if the Android is not root mode. That means the application can not use some API of Android. That means there are [B]official (supported) root API[/B]s of Android (by Google) ? If yes, can … | |
at first, plec correct me this one... [code] std::string explanation; // this upper coding char explanation; //after entering void to display if(item_code=='A') explanation='BABY WEAR'; else if(item_code=='B') explanation='CHILDREN WEAR; else if(item_code=='A') explanation='LADIES WEAR'; else if(item_code=='A') explanation='MENSWEAR';[/code] BABY WEAR and others was error, what should i put? plz correct my coding above … | |
This is the program I wrote for my CS project. Compiler is TurboC++. I initially added a lot of garbage code in it and am having a hard time cleaning it up. Can you guys please suggest improvements in the code below. Thanks in advance. [CODE] //STUDENT MANAGEMENT #include<conio.h> #include<fstream.h> … | |
For some reason, when I do an output.put, it is not doing anything. [CODE]#include "stdafx.h" #include <fstream> #include <Windows.h> using namespace std; void main() { fstream input, output; int in1=0, in2=0, x=0, k=0, l=0, max=0; input.open("input.txt", ios::in); output.open("output.txt", ios::out); while(input.good()) { input>>in1; input>>in2; for(x=in1; x<in2; x++) { k=x; l=0; while(k!=1) … | |
[CODE]#include<iostream> #include<fstream> #include<string> #include<vector> #include<algorithm> using std::cin; using std::cout; using std::string; // clothing codes struct codes { char code; const char* explanation_1; float total_sales; }; codes CODES[]={'A',"BABY WEAR",0.0F, 'B',"CHILDREN WEAR",0.0F, 'C',"LADIES WEAR",0.0F, 'D',"MENSWEAR",0.0F, 0,NULL,0.0F }; struct RECORD { char category; int item_number; float price; }; const string filename="jualan.dat"; int menu(); … | |
so, this is my coding. [code]#include<iostream.h> #include<fstream.h> #include<stdlib.h> #include<iomanip.h> using std::cout; using std::cin; using std::endl; struct menu typedef struct menu RECORD; void addRecord(RECORD input[], int arraycounter); void printRecord( input[]); void printAllRecord( input[]); int main() { fstream submit; submit.open("D:jualan.dat",ios::out); { int menuEnter; int arraycounter=0; do { cout<<"\tFamily Outfit Shop"<<endl; cout<<"\t MAIN … | |
Hi guys, I have written a program that writes a .csv file readable in Microsoft excel. Is there a way I can launch the file with Microsoft excel once I compile and run the program? [CODE] #include <iostream> #include <cstdlib> #include <fstream> #include <cmath> using namespace std; int main() { … | |
[CODE]#include <iostream> //standard input and output #include <fstream> //file input and output #include <string> //for strings #include <exception> //catches exceptions #include <sstream> //stringstream comes from here #include <algorithm> #include <stack> #include <queue> using namespace std; bool writeFile(const string &data); //writes strings to file bool readFile(); //read file bool palin(const string … | |
I'm using turbo C++. For my SIC assembler I need to read user the input assembly language program from a text file.Each line of the program contains a maximum of 3 words , LABEL OPCODE and OPERAND. LABEL or OPERAND or both can be absent by OPCODE is a must. … | |
My enscription program enscripts the words in a text file, but when I descript it is all mixed up eg. Origanal text: Name: Master Surname: Hacker Age: 1101 Enscripted text: 6BX5 6BX5 + BX0 6BX5 + BX0 9BXIIHI Descripted text: Name: MasteName: MasteName: MasteName: MasteName: MasteSuName: MasteName: … | |
With the recent announcement of an easy way to gain root access for Android phones running 2.3.4, to add to the list of similar exploits for earlier versions and 3.0 and beyond, it should come as no real surprise that the bad guys are taking advantage of the relative weakness … | |
I am trying to sort a record according to their respective number like this: [CODE] 5 reyes d r 1 2 3 3 delos d k 4 5 6 9 go t r 7 4 5 1 po w w 2 2 2 2 bun b m 3 3 3 … | |
I'm making an SIC 2 pass assembler in C++. And I'm not very good at files in C++. The following code segment is supposed to read LABEL OPCODE OPERAND from the input text file . All it has to do is to identify each of those based on the tab … | |
Prekė.h [CODE] #include <string> using namespace std; class Prekė { private: string pavadinimas; double pagaminimodata; int kiekis; double kaina; double vartojimolaikas; public: Prekė(); Prekė(string pavad, double pagam_dat, int kiek, double kain, double vart_laik); ~Prekė(); string ImtiPavadinimą() { return pavadinimas; } double ImtiPagaminimoDatą() { return pagaminimodata; } int ImtiKiekį() { return … ![]() | |
[CODE] #include<iostream.h> #include<stdio.h> #include<fstream.h> #include<string.h> class qa { char question[35]; char option[4][20]; int ans; //correct option no (eg 0 1 2 3) public: void getques() { gets(question); cout<<endl; } void getopts() {cin>>option[0]>>option[1]>>option[2]>>option[3]; } void getans() { cin>>ans; } }; void main() { int n; qa q; fstream file1; file1.open("questions.dat",ios::out); cout<<"\n … | |
Using a text editor (i.e. Notepad), create a text file called Text1.txt and place it into a folder of your choosing. Fill Text1.txt with a sentence and save the file. Then, write a C++ program that performs the following: 1. Reads the sentence from the file Text1.txt and display it … | |
I have to count the number of records being read in and print them to the screen. A record consists of: website name (temp.url), website revenue (temp.rev) and website hits (temp.hits). These are all read in and returned as temp. For the life of me though, I can't figure out … | |
can someone please help me with this code? i am getting the following error : [Linker error] undefined reference to `enr(int, int, double, double, double)' thanks #include <iostream> #include <fstream> #include <math.h> #include <string> using namespace std; float ran1(long *); #define IA 16807 #define IM 2147483647 #define AM (1.0/IM) #define … | |
Using microsoft visual c++ 2010. Everything is screwing up. I want to take an input file, write to an output file, and use the lines of the input file as strings. But... On previous run, I didn't have that last printf line. So everytime I run it, it just prints … | |
Hi i need a little help. i want to read a multi array from a file but code blocks said a lots of error and i dont know whats the problem. can u help me? [ICODE]#include <iostream> #include <cstdlib> #include <math.h> #include <fstream> #include <sstream> using namespace std; int maxn=100; … | |
Hey guys, So I have to convert my previous code into a code using pointers and dynamic storage and the problem is, I have no idea how. I have already read on another forum's examples of Pointers and watched a few tutorials (simple ones) and read from my textbook. Unfortunately, … | |
Here is the program assignment: [icode] Graph abstraction is important because it is used in many different areas of science, engineering, computer sciences and software engineering. For instance, the Internet makes use of graphs to represent the Internet router network configuration in order to determine the best route for forwarding … | |
Hello, I have a problem in reading p5 PGM file: [CODE] ifstream::pos_type _Start, _End, _Size; ifstream::off_type _newStart; char * memblock; vector<vector<int> > initMatrix ; std::ifstream inf; inf.open("a.pmg", ios_base::in | ios_base::binary); if (inf) { std::string line; for (int i = 0; i<3 ;i++)//skip the first 3 lines that contain the info … | |
So here I am, having a difficult time figuring out what's the problem, first of here's the code: [COLOR="red"]Preke.H[/COLOR] [CODE]#include <string> #include <sstream> #include <iomanip> using namespace std; class Preke { private: string pav; // prekės pavadinimas int atdata; // atvežimo į parduotuvę data int pardata; // pardavimo data int … | |
Passing Managed ByteArray to Native C++ DLL Anyone could help regarding passing ByteArray containing image data from axis camera to Native C++ DLL, Both compile OK, but DLL does not write ByteArray data to file?, just wondering if this is the correct way to pass ByteArray's to C++ DLL's here … | |
I am using window 7 as a operating system and i run this code in same os it shows the problem related to file handling but this problem wasn't occurred on xp and vista whats the problem ........???????????? try to run on win 7 and xp you will get the … | |
Can someone please tell me why I am getting an error message saying 'temps' is uninitialised??? [CODE]#include <iostream> #include <string> #include <fstream> #include <sstream> #include <cmath> #include <iomanip> #include <cmath> #include <cstdlib> using namespace std; struct record { string websiteUrl; double revenue; int hits; }; struct totals { double totalRevenue; … | |
what I mean by undefined error is because I don't know what the error is about. :P, actually it's because the error not from the code itself, but it's about a compiler that can't defined some sort of file... btw, as title said, the error is from the code in … | |
[CODE]#include<conio.h> #include<stdio.h> #include<iostream.h> #include<process.h> #include<dos.h> #include<time.h> #include<fstream.h> #include<string.h> class getInfo { int dep; int with; int bal; int year; int mon; int day; char des[100]; public: getInfo() { dep =0; with =0; bal =0; year =0; mon =0; day =0; strcpy(des,""); } int year1() { return year; } int month1() … | |
these one code, from line [63-71] of the original code [CODE] // for adding more students cout << endl << "Want to add more student?(yes/no): "; string add_student; cin >> add_student; if(add_student == "yes") { student_counter = 0; } [/CODE] the program seems "doesn't detect" the cin code above, it … | |
hey guys, I'm writing a program and trying to output data to a file and I'm getting this error: 1>------ Build started: Project: GenericProgram, Configuration: Debug Win32 ------ 1> Source1.cpp 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\fstream(1116): error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>' 1> with … | |
Ok i have a problem which i cant seem to figure out why it is not woriking, First off When i do Enter in some Details and want to enter Records to the end of File it give me the choice of enter in the Details. When display the Array … | |
Hey all. I'm trying to get the FindDaysOver function to grab the avg result from the CalcAvg function result in main. What am I doing wrong? Any help would be appreciated! [CODE] #include<iostream> #include <iomanip> using namespace std; double FindMax(double [], int); double FindMin(double [], int); double CalcAvg(double [], int); … | |
I am working on a binary search tree and have came across a few problems that I can not figure out how to correct and was wondering how to fix them. In my program I am adding, deleting, printing, updating, and counting the total number of nodes. The only things … | |
I have a file that has the layout: [CODE] 0 0 0 1 1 0 1 1 [/CODE] I want to read it into a multidimensional array and use the values. The thing is I don't know how to read it in.. I can read the amount of columns and … | |
i made a program in dev c++ to merge contents of two files into a single file but the merged file is showing garbage outputs. question:- Write a C++ program to merge the content of two files namely “Employee.txt” and “Salary.txt” into “EmployeeDetails.txt”. Sample contents of Employee.txt EmployeeName EmployeeNumber Department … |
The End.