No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I have the following code which basically acts as a typewriter: [code] int main () { char c; puts ("Enter text:"); do { c=getchar(); putchar (c); } while (!feof(stdin)); return 0; } [/code] However when I feed it a text file for input: [icode]$ ./typewriter < input.txt[/icode] it always adds … |
|
Re:
Hello for my C++ programming class I am programming a Dictionary program that allows the user to enter in definitions and stores them between 2 classes. Dictionary which will contain all my entries and Entry which will contain the definition for every word that the user inputs. Now when they … |
|
In my program I am creating a class instance then writing it to a binary file. I do this several times so I have several instances of this class in my file. Then I want to access them individually, read them back into an instance in the program, change its … |
|
Re:
how do i solve this problem r+5(r-2)=28 3(r+4)+5(r+2)=102 |
|
I have a templated class set up like so: [code=CPP] template<typename T> class treeNode { public: bool operator==(const treeNode<T>&) const; bool operator>(const treeNode<T>&) const; void print(); T field; int key; }; [/code] Using the > operator as an example of my problem, I have it overloaded like this: [code=CPP] template<typename … |
|
Re:
So I would like to know if there's any way to do the following more efficiently: [CODE]while(g[0] = 0 || g[0] = 1 || g[0] = 2 || g[0] = 3 || g[0] = 4 || g[0] = 5 || g[0] = 6 || g[0] = 7 || g[0] = … |
|
My code so far opens a text file in a particular format and reads in the data into a structure called salesRecord. There is no problem there. The problem arises when I write the data to a new binary file. Here is the structure: [code=CPP] struct salesRecord { int custNo; … |
|
Re:
Hello, I'm working on a project for my master degree that uses codes called CurveLab [url]http://curvelet.org/software.html[/url] I don't know how to install it to my system. I tried to follow the steps but I filed to do so. Can anyone help me with doing that? I'm really in need to … |
|
Re:
I have an AlphaSeats [60] array and the loop I did, changes the value to 0 and it's suppose to stop when it reaches the index 59 but it goes on and end up changing other variables - PartyName, PartySize and Airplane value to 0 too... Here is the code. … |
|
Hello again. I was shown this small piece of code when making a command-line based menu, where you enter a number to perform a certain function. [code] while (true) { displayMenu(); if(!(cin >> key)) { if(!cin.eof()) { cin.clear(); cin >> dump; } continue; } // etc [/code] I cut the … |
|
I tried searching the forum, but I couldn't find any threads that really dealt with what I'm trying to do here. I have a struct set up with three fields (shown below). [code] struct StudentInfo { char id[10]; double mark; char grade; }; [/code] [I]Note that the id MUST be … |