Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~10.3K People Reached
Favorite Forums

11 Posted Topics

Member Avatar for Reprise

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 …

Member Avatar for Reprise
0
97
Member Avatar for Loranus

Why do you want to do that? The name of the object is arbitrary, it's the data inside that is important.

Member Avatar for mattjbond
0
122
Member Avatar for Reprise

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 …

Member Avatar for Reprise
0
252
Member Avatar for James19142

niek_e is correct about the second equation having r = 10. I didn't see anyone give a correct answer for the first, so I will: r = 19/3. [QUOTE=niek_e;1023999]You shouldn't drink and drive and you should smoke and do math. That's how people come up with stuff like the Large …

Member Avatar for mrnutty
-1
226
Member Avatar for Reprise

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 …

Member Avatar for xxjay922xx
0
99
Member Avatar for Xantox

[url]http://www.daniweb.com/forums/post1021268.html#post1021268[/url] That post describes how to verify that input is an integer. It takes a user inputted string and looks at each character, one at a time, to make sure it's either an integer (0-9) or the '-' character. Maybe that will help.

Member Avatar for Sky Diploma
0
126
Member Avatar for Reprise

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; …

Member Avatar for dkalita
0
8K
Member Avatar for mohd9789

I'm not exactly sure about CurveLab, but in response to the thread subject there are a few C++ compilers out there for OSX. I use XCode, it comes on your OSX install disc.

Member Avatar for mohd9789
0
97
Member Avatar for thiemebr

After you fixed your "for" loop I don't see a problem... other than in C++ the main function needs to have an integer return type.

Member Avatar for Reprise
0
83
Member Avatar for Reprise

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 …

Member Avatar for ithelp
0
99
Member Avatar for Reprise

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 …

Member Avatar for Reprise
0
1K

The End.