56 Topics
| |
I am working with a code which stores the information of customers in a file called customer_details.txt then asks the user to enter a name and then searches for the name in customer_details.txt, if the name is found, the entire details of the user is displayed on the output screen. … | |
Hi all! Whenever I am working with my code in my main.cpp file, I can call character-handling functions like * isdigit * isalpha * isspace * toupper without importing the `cctype` library. However, my C++ How to Program Book shows that the cctype library must be imported before the functions … | |
Hi, As we know constructor doesn't have any return value so it is not good idea to perform exceptional handling inside constructor.SO i would like to know if i am opening a file inside constructor and due to some reason (file not exist) failure happened inside constructor then how to … | |
fstream file; file.open("PasswordGenFile.dat",ios::out); In writing into a .dat file what does the following line mean? file.write((char *) this, sizeof(PasswordGenerator)); And how can i convert this bit of code if i want to write it into a .txt file? | |
the problem I have here is: when I input an integer it works fine, but when i input any other thing, it doesn't give me a chance to input again when the loop iterates, it just keeps printing "error type the right thing" to the screen even though "cin var" … | |
I have a text file and i want to replace a word from a specific location. For example want to replace 5th word from 12th line of file. How i can do that? | |
Following exceptions are `Checked Exception` or `Unchecked Exception` ArrayStoreException IllegalArgumentException | |
I am asking a question about file handling within python. I am capable of creating a text file which can then be read via python. However, i am trying to create a python Recipe storer and therefore i would need to be able to store recipes (entered through python) with … | |
Hi All, i am here with a problem in file handling in java. i need to search all the files on system with extention *.fdr. which are not less den one day old. then i need to convert the selected file to csv which is perfomed by a command in … | |
I have a text file transa.txt .I want the contents of the file to be filled in the array cell by cell.example the file reads: 1 1 1 1 0 0 1 0 1 1 1 1 so i want arr[0][0]=1,arr[0][1]=1,arr[0][2]=1...... Can someone please help me with this..I am stuck … | |
give me coding for search and edit a file in c++ | |
I have attached one code of my project and i need a help in that. The code is running without any error but i am stuck up in modifying that how to make a statement, of invalid format of date or time if the user enters the wrong format should … | |
| hi i have problem , i want to modify a file without copy to another file so any one can give how to do it ? I tried following method to modify a given location or pointer in file but did not work . ofstream outfile; outfile.open ("test.txt"); outfile.seekp (3,ios::beg); … |
Here is exercise in error handling, while looping and for looping with itertools.chain. It is also exercise of functions not letting user to go without giving proper input. I call them to myself 'jail functions'. Here you could add as an exercise breaking out of loop and continuing until user … | |
Hi All, Could you please clear my doubt why this second catch block is called when exception is thrown only once. #include <iostream> using namespace std; class E { public: const char* error; E(const char* arg): error(arg) {} }; class B { public: B() {}; ~B(){cout<<"~B() called"<<endl;} }; class D: … | |
I have been working on a conversion project for last few days where I need to convert a Java library to C#. At one point I came to java's certain feature called [Exceptions Thrown by a Method](http://docs.oracle.com/javase/tutorial/essential/exceptions/declaring.html). Here is a little glimpse of it: public boolean isRequest() throws NullPointerException { … | |
Telling you before hand, i am just starting to learn, so please refrain from making fun of me i k i am real weak in this. ok here is what i need to do, i have been trying for ages but i am having huge problem creating dynamic checkboxes. This … | |
Program to Find the words starting with a or A from the source code itself and then modify it by removing the words from the source code and put it in another file. The following code doesn't work. Pls Help!!! #include<iostream.h> #include<conio.h> #include<fstream.h> #include<string.h> void Write(fstream &a, char b[]) { … | |
Hi, Can anybody help me out to solve string handling without using predefined spilt function , here come the questions for eg i have a input string as "hai welcome to the sample " so i should display as follows hai welcome to the sample pls advice, thanks for your … | |
consider the following program #include<iostream.h> #include<fstream.h> void main() { int no; ifstream fin; ofstream fout; fout.open("create,dat",ios::app); fout<<"What is your fav. number"; fin>>no; fout<<no; fout.close(); } NOW HERE IS THE PROBLEM WHILE THE PROGRAM IS RUNNING PERFECTLY AND THE NUMBER IS BEING STORED IN A .DAT FILE BUT THE NUMBER IS … | |
Hello, I have a problem when trying to prompt users on two levels with Perl. The first prompt command works fine. But when doing the second command as below, I get Enter a command (count/close/quit) : Enter a command (open/quit). I don't see right away why this happens. Any idea? … | |
Greetings I have a USB RFID scanner. While I have this form1 up, I want to send any keyboard input and put it in a textbox which is in another form(say form2). I tried using this code but to no avail. The first form is named "MainMenu". Every time of … | |
Well Guys! I was learning how to read and write class objects from & to file respectivily. And here is a small code that i made...... As far as the code goes its all well.... And i am getting what i want.... But what i want to know is, **where … | |
Here is what I am trying to do: From VB.net open a word template --- Done Populate it from a database ------Done Have word report back with the saved file name so as I can add it to the database history ----Not done. I know is has something to do … | |
case 4: { cout<<"Enter the word you want to delete: "; gets(b); f1.open("anotherf.txt",ios::in); f2.open("tempf.txt",ios::out); while(!f1.eof()) { f1>>a; i++; if(strcmp(a,b)==0) { j=i; } } i=0; while(!f1.eof()) { if(i!=j) { f1>>a; f2<<a; } i++; } f1.close(); f2.close(); f2.open("tempf.txt",ios::in); f2.seekg(0); f1.open("anotherf.txt",ios::out); while(!f2.eof()) { f2>>a; f1<<a; } goto menu; } I am trying to … | |
hi plz tell me the coding of exception handling in java.. | |
Write a program (in a single .c file) with a queue of strings implemented using array. You should write ite a queue type. The program reads a set of strings stored in a file (filename given on command line as argument) and inserts each string in the queue. Then it … | |
Hi all, I am creating one GUI application in java. I need to make menubar visible when particular panel is made invisible. Is it possible by creating an event which will be triggered when panel is made invisible? Can anybody help me? Thanks in advance!!! | |
Following is my code for reading from a file. #include<stdio.h> int main() { char s[10][10]; int i=0,j=0; FILE *ptr=fopen("input.txt","r"); char c; while(fscanf(ptr,"%c",&c)!=EOF) { if(c=='\n') { s[i][j]=0; i++; j=0; } else { s[i][j]=c; j++; } } s[i][j]=0; fclose(ptr); for(j=0;j<i;j++) printf("%s\n",s[j]); return 1; } and content of input.txt is A->XAZ|Yz|z X->xZ|x Z->Xz … | |
I am having trouble figuring out how to handle events for components that are created when I click a button. I have a class called rows which is used to create a row of components (combo boxes) . I have a button on my form that has an event to … |
The End.