Forum: C++ Feb 11th, 2009 |
| Replies: 7 Views: 1,055 Yes thank you arkM
The examples I looked at didn't have the fixed manipulator in them. I just found this out at school talking to another student.
Thanks |
Forum: C++ Feb 11th, 2009 |
| Replies: 7 Views: 1,055 The problem with using setprecision() as I tried to point out in my original post is that it doesn't work if the number is different.
If I use setprecicion(4) for 16.252 it will work displaying... |
Forum: C++ Feb 10th, 2009 |
| Replies: 7 Views: 1,055 Hi, I have read about using sprintf and tried it but can't make sense of how it works.
I have a double with the value 16.525 .
I want to cout only 16.53
I also tried setprecision() and it... |
Forum: C++ Aug 10th, 2008 |
| Replies: 5 Views: 2,574 Well I'm trying to learn all methods available for executing directly from a program I write in c++. I was just mentioning the VB way because I'm looking for something similar in c++.
The VB... |
Forum: C++ Aug 10th, 2008 |
| Replies: 5 Views: 2,574 Thank you williamhemswort. My internet has been down so I couldn't be online for a while.
I can definitely start there. I'll have to figure out how to translate that into running apps on linux... |
Forum: C++ Aug 9th, 2008 |
| Replies: 5 Views: 2,574 Hi, I've been looking around for how to execute another application from a c++ app.
I remember in VB I could have my app launch the browser or other app and could even have it launch command line... |
Forum: C++ Jul 2nd, 2008 |
| Replies: 12 Views: 2,098 Thanks Ancient Dragon. I got some advice on how to display the decimal representation.
for(size_t i=0;i<memblock.size();++i) std::cout << int(memblock[i]) << std::endl;
Turns out the binary is... |
Forum: C++ Jul 2nd, 2008 |
| Replies: 12 Views: 2,098 I feel like a dummy. That part with "iter ==" was a common mistake in c++ class that I usually spotted and corrected in other peoples code. Thanks for pointing it out.
It works now but I thought I... |
Forum: C++ Jul 2nd, 2008 |
| Replies: 12 Views: 2,098 why did unsigned not work and what about the &?
It still gives "error...program has to close" unless I put the ios::ate back in. For some reason, that makes it stay open, but it's not printing out... |
Forum: C++ Jul 2nd, 2008 |
| Replies: 12 Views: 2,098 Ok I simplified the whole thing. Now I have an error for "while (file.get(&byt)".
error: 16 X:\testingBinaryFileRead\newBinaryRead.cpp no matching function for call to `std::basic_ifstream<char,... |
Forum: C++ Jul 1st, 2008 |
| Replies: 12 Views: 2,098 Any good books specifically for this topic?
When you say "while (in.get(&byt);
is "in" the name of the file stream?
So I just need to open a fstream called "in" or whatever and use it that way... |
Forum: C++ Jul 1st, 2008 |
| Replies: 12 Views: 2,098 Hi, I am trying to learn how to read the binary of a file, such as a jpg. I got something going here but at run time in windows it says there is an error and the file must close.
I'm not even sure... |
Forum: C++ Jun 7th, 2008 |
| Replies: 4 Views: 1,115 I tried this and it is counting and skipping the first two lines but now the second "while" is not using commas as a delimeter. It's reading them into the vector. How can I delimit with '\n' and then... |
Forum: C++ Jun 7th, 2008 |
| Replies: 4 Views: 1,115 sorry, I don't know anything about flags or how to use a boolean to check if the line already exists.
I'm not sure how to check for headers. There's nothing special about them. I just added lines... |
Forum: C++ Jun 7th, 2008 |
| Replies: 4 Views: 1,115 Hi, I have a readFile() function that reads a csv file into a vector.
The first two lines of the csv are collum headings.
After reading and displaying the file on screen, replacing ","'s with... |
Forum: C++ May 27th, 2008 |
| Replies: 21 Views: 34,047 I can not find unistd.h anywhere on my system.
So let me see if I understand this.
POSIX is the linux API just like there's a Windows API.
By changing pause to pause2, we have something that... |
Forum: C++ May 26th, 2008 |
| Replies: 21 Views: 34,047 Thank you John A and Narue.
I never would have thought of something like that since I'm a noob. I don't know enough to decide between windows, linux and the different compilers who is complying... |
Forum: C++ May 26th, 2008 |
| Replies: 21 Views: 34,047 looks like Naure covered a lot of bases with one class of functions which is great.
I appreciate your comedy ruotine Traicey, but if there is an easier way to be able to flush,empty,ignore (what... |
Forum: C++ May 25th, 2008 |
| Replies: 7 Views: 5,677 OK thanks a lot Duoas :-)
I was able to incorporate using a vector and am working on adding in a string stream now so I can parse it twice for the purpose of reading and writing csv files from... |
Forum: C++ May 25th, 2008 |
| Replies: 7 Views: 5,677 Thanks for the advise on safety. Can you tell me what is the deal with
int count = 10;
while (count > 0;
and
count--;
I know what they are but what is there purpose? Why count down from... |
Forum: C++ May 24th, 2008 |
| Replies: 7 Views: 5,677 yeah sorry, I just figured that out.
Thanks :-) |
Forum: C++ May 24th, 2008 |
| Replies: 7 Views: 5,677 sorry, comments didn't keep format when I posted. |
Forum: C++ May 24th, 2008 |
| Replies: 7 Views: 5,677 Hi, I am writing a program to read from a file.
I want to ask the user for the file name to open.
I have tried to use the basic open file code from cplusplus.com and it won't work unless I... |
Forum: C++ May 23rd, 2008 |
| Replies: 21 Views: 34,047 after looking up ambiguous, I'm wondering if this code could or should be rewritten so it can be called as a member function instead of as cin >> pause(). Don't know, just throwing the idea out... |
Forum: C++ May 22nd, 2008 |
| Replies: 21 Views: 34,047 works great for windows. I saved it as ignoreline.h and use it as an include.
Doesn't work in linux. Anyone know why?
Compile time error message:
clearTheStream.cpp: In function ‘int... |