No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
MIS Helpdesk
- Interests
- I don't have time for hobbies.
- PC Specs
- PC: Intel 2.8Ghz P4, 1 gig ram, xp pro, 256 PCI Express video Laptop: Intel 2.8Ghz, 1 gig ram, xp home,…
11 Posted Topics
Re: I have what sounds like the same assignment and yes that will work. If this is the same assignment, use a vector because the assignment specifies this type. Then, test for evens and odds. The first index is zero which is even so add evens and subtract odds. | |
Re: I would say that you just need to set the precision and/or the fixed notation. The setprecision and fixed manipulators can be set and all floating point output will use this format until you choose different formats. So, if you have the following: [code] double Pi = 3.1429 cout << … | |
Re: Yes a .dat is just a different file extention. You can create this in windows with just notepad and when you save it make it filename.dat. Actually, in Linix/Unix it is the same. Just save it with filename.dat. | |
Re: Have you tried the setw(int), setfill, and/or alignment manipulators? These are usable if you include the <iomanip> and <iostream> headers. Try searching on them and see if you find what you need (I will bet this has been asked in this forum before if you have the time to search … | |
Re: Lets say the buttons are b1 through b10. Will these be in order? If so. then this is rather easy. Your index values will be 0-9 or buttonN -1. So, when the user asks for a particular button, i.e. button 4 should have text ..., then you just need to … | |
Why are my exceptions not working? here is the teststack.cpp #include <iostream> #include <iomanip> #include "teststack.h" using namespace std; struct StackFullException { StackFullException(); }; StackFullException::StackFullException() { cout << "The stack is full."; } struct StackEmptyException { StackEmptyException(); }; StackEmptyException::StackEmptyException() { cout << "The stack is empty."; } Here is the … | |
What is wrong with this: [code] for(int b = 0;b < c.length();b++) { temp[b] << S.Pop(); // or temp[b] = S.Pop(); } [/code] to have a string made up of the contents of the stack? When I do this and cout << temp, temp is blank. This iterates through the … | |
What is happening here? [code] void palindromemgr(ifstream& in, ofstream& out, Stack& S) { string c; //candidate while (true) { cout << "entering first loop" << endl; //debugging line if (in.eof()) break; in >> c; cout << "this is the value in c :" << c << endl; //debugging line for … | |
I need to use a class for a program that reads an input file, prints the file, sorts the list then prints the sorted list. This is for a Programming II class. I can see how to print and sort. My issue is the input file and the array. I … | |
Well, here is the gist of the problem. When I read in a file of integers, if there is a formatting character at the end, the last integer is repeated. For instance, in the code, it is reading i01.dat. If that file reads as follows: 2 3 4 5 with … | |
I am actually having two problems. The first is initializing a char array to a single space for all elements. I have the loop to do this but the assignment to the value: " " is returning a compile error: error: invalid conversion from `const char*' to `char'. Then, when … |
The End.