Search Results

Showing results 1 to 40 of 263
Search took 0.08 seconds.
Search: Posts Made By: Duoas ; Forum: C++ and child forums
Forum: C++ Aug 7th, 2009
Replies: 7
Views: 381
Posted By Duoas
A std::vector is guaranteed to maintan contiguous data space -- meaning it cannot handle really large data.

Use a std::deque instead. I looks much the same, but the data need not be stored...
Forum: C++ Jul 21st, 2009
Replies: 13
Views: 1,546
Posted By Duoas
Sorry to respond to this late... but I wanted to post info also...

The getline() function has the obnoxious habit of returning a not good() stream for final blank fields...

For a single blank...
Forum: C++ Jul 6th, 2009
Replies: 30
Views: 1,534
Posted By Duoas
I agree with AD that the FTP is probably what is going wrong.

FTP defaults to text mode. You must explicitly set it to binary mode before copying files.
Forum: C++ Nov 20th, 2008
Replies: 14
Solved: Crash Windows
Views: 1,207
Posted By Duoas
>So there's absolutely no way possible for the average person to write to it?
No.

>I was just curious, I absolutely do not want to make any type of virus, trojan, or malware.
Anything that...
Forum: C++ Nov 20th, 2008
Replies: 5
Views: 532
Posted By Duoas
First off, you are being a bit pushy. Stop. Sometimes it takes a day or two to get a (useful) answer.

Secondly, if you can't use C++, then you are posting in the wrong forum.


A good DLL to...
Forum: C++ Nov 20th, 2008
Replies: 14
Solved: Crash Windows
Views: 1,207
Posted By Duoas
No.

The kernel is write-protected and you have to know the right magic to get past that.

Deliberately crashing the kernel isn't funny. It is downright dangerous. You can utterly destroy your...
Forum: C++ Sep 24th, 2008
Replies: 4
Solved: Bit String help
Views: 1,638
Posted By Duoas
I think you'll have to go ask your professor for clarification. Sorry.

Oh, the bit position is indexed like an element of an array. So if your bits do represent strings (as in vector <string>...
Forum: C++ Sep 24th, 2008
Replies: 4
Solved: Bit String help
Views: 1,638
Posted By Duoas
Your assignment is the kind of exactingly vague description I've come to expect from CS instructors. Do you have an exemplar of the input file? I will assume some things from here on:

A bit string...
Forum: C++ Sep 9th, 2008
Replies: 2
Views: 840
Posted By Duoas
Complain to your vendor. If their DLL is broken they are obligated to fix it.

Otherwise, read on:

For some oddball reason the C++ design doesn't think that system exceptions belong as part of...
Forum: C++ Sep 1st, 2008
Replies: 8
Views: 768
Posted By Duoas
Argh! I'm so sorry! (Recent med changes have made my brain work worse than usual...)

I forgot a couple of things:
force proper type comparison
non-ASCII characters

This will work. (I tested...
Forum: C++ Sep 1st, 2008
Replies: 8
Views: 768
Posted By Duoas
Yes, it is an encoding issue. I suspect that it comes from the way your editor is saving the text file.

There are several ways to 'encode', or store, character data.

There is the old char-sized...
Forum: C++ Aug 27th, 2008
Replies: 11
Views: 985
Posted By Duoas
I would suspect all that debug code in the VC++ options, and it doesn't look like you have many optimizations enabled either...

Go to your project options and disable debug info and enable all the...
Forum: C++ Aug 22nd, 2008
Replies: 4
Views: 494
Posted By Duoas
If I understand you correctly, you need to look in your documentation at SetWindowPos() for the SWP_FOO flags.

Hope this helps.
Forum: C++ Aug 21st, 2008
Replies: 2
Views: 740
Posted By Duoas
If you are not on windows, or you just want something more cross-platform, you'll need to use a GUI toolkit. The universal favorites are (in no particular order):

Trolltech Qt...
Forum: C++ Aug 16th, 2008
Replies: 18
Views: 4,001
Posted By Duoas
In addition, you should have a removeBook() (or some such named) method(s) for the user's convenience.
Forum: C++ Aug 9th, 2008
Replies: 6
Views: 790
Posted By Duoas
There isn't really any clean solution.

Remember, a template class is an incomplete type. It is only when you parameterize it that it becomes a complete, concrete, usable, valid type.

So vector...
Forum: C++ Aug 8th, 2008
Replies: 19
Views: 2,017
Posted By Duoas
You know, I thought I had responded to this thread yesterday, but now I remember I was called away before I could finish typing.

'Bitfields', in the sense of using individual bits in an integer...
Forum: C++ Aug 8th, 2008
Replies: 15
Solved: namespace std
Views: 1,442
Posted By Duoas
semicolons
A semicolon by itself is considered a null statement, and has no meaning. Modern compilers will typically complain about them unless they explicitly terminate a statement. For example...
Forum: C++ Aug 5th, 2008
Replies: 6
Views: 596
Posted By Duoas
You have three cs there:
line 51
line 55
line 59
Your loop will never terminate because every c is always == first (so no matter which of the three the compiler chooses to use you've got an...
Forum: C++ Aug 5th, 2008
Replies: 18
Views: 1,201
Posted By Duoas
Now you have confused me.

You don't need to allocate the size of a std::string --that's the whole point. But you do need to specify the size of a c-style character array.

Both my methods are...
Forum: C++ Aug 5th, 2008
Replies: 18
Solved: enum warnings
Views: 1,667
Posted By Duoas
Don't test against true. Test against false.

That is the danger in defining values for true and false. Just remember, always (and this is one of 'those' rules...) explicitly test against false....
Forum: C++ Aug 5th, 2008
Replies: 18
Views: 1,201
Posted By Duoas
You are confounding c-style strings and stl strings.
An old c-style string:

#include <cstring>
#include <iostream>
using namespace std;
int main()
{
char name[ 100 ]; // this is an...
Forum: C++ Aug 4th, 2008
Replies: 2
Views: 1,762
Posted By Duoas
The main problem is that iostreams cannot be copied. Consider for a moment the horrors that can occur if you have three copies of an object that manipulates a file sitting around.

You must pass...
Forum: C++ Aug 3rd, 2008
Replies: 16
Views: 1,870
Posted By Duoas
Right. The va_args don't work with object-types.
Forum: C++ Jul 26th, 2008
Replies: 3
Solved: switch problem
Views: 442
Posted By Duoas
Olvidaste poner conullas al seis. while (producto != '6')
:$

Hope this helps.
Forum: C++ Jul 24th, 2008
Replies: 2
Views: 1,507
Posted By Duoas
I have never played directly with Qt stylesheets... but it appears that you need to provide an image for the indicator with the color you want. Here's what I found about it:...
Forum: C++ Jul 23rd, 2008
Replies: 7
Views: 2,982
Posted By Duoas
Since you are compiling with the UNICODE flag, you must either indicate that string literals are wide-char directly: L"Hello world!" or (better yet) use the TEXT() macro:
PlaySound(TEXT("beep.wav"),...
Forum: C++ Jul 20th, 2008
Replies: 13
Views: 3,144
Posted By Duoas
What you have written is a data class, and either your professor will have you extend it or will have you write a templated linked-list class and use Contributor in a linked list.

I've really only...
Forum: C++ Jul 20th, 2008
Replies: 3
Views: 1,201
Posted By Duoas
That's not a problem. Underneath a std::string or a std::vector is just an array anyway, except that all the nasty details of managing it are taken care of for you.

So, yes, use c_str() to get a...
Forum: C++ Jul 19th, 2008
Replies: 7
Views: 605
Posted By Duoas
Just a quick glance it looks OK.

The insertion operator prototype should list its second argument as const:
ostream& operator << (ostream& out, const Contributor& InContributor)

What makes one...
Forum: C++ Jul 19th, 2008
Replies: 7
Views: 605
Posted By Duoas
"Overloading" (at least in C++) means that you have more than one function with the same name. In this case, you have three different constructors, but they all have the same name.

The difference...
Forum: C++ Jul 19th, 2008
Replies: 3
Views: 1,201
Posted By Duoas
The only two things I see that are guaranteed problems are first in EnterName(). You should input text using getline().

void WordRead::EnterName()
{
cout << "Type in the text file path you wish...
Forum: C++ Jul 18th, 2008
Replies: 4
Views: 528
Posted By Duoas
If you are using the Express edition, you can't.
If you purchased VS, then call the MS support and ask.
Sorry.
Forum: C++ Jul 18th, 2008
Replies: 4
Views: 494
Posted By Duoas
You have discounted newline conversions.

On Windows, the newline character represents the ASCII sequence CR LF.
When your program reads it, it gets '\n'. The newline is encrypted thus and so the...
Forum: C++ Jul 7th, 2008
Replies: 9
Views: 3,874
Posted By Duoas
Ah, it is because seating is declared as a 2D array, but you are only indexing one dimension. Hence the error.

Did you mean to treat seating as a 1D array in your function? I'm not sure how you...
Forum: C++ Jul 7th, 2008
Replies: 9
Views: 3,874
Posted By Duoas
The compiler believes that seating is an integer. The OP placed the cast there to try to get rid of the error message.

Can we see the class definition where seating is declared? Is there anything...
Forum: C++ Jul 7th, 2008
Replies: 2
Solved: i++ vs. ++i?
Views: 2,438
Posted By Duoas
C++FAQ-Lite 13.15 (http://www.parashift.com/c++-faq-lite/operator-overloading.html#faq-13.15)

Hope this helps.
Forum: C++ Jul 7th, 2008
Replies: 4
Views: 941
Posted By Duoas
I don't know how you got that far...

You never initialize coeffs. You must set its length before playing with any elements. Or push elts onto the end.

Hope this helps.
Forum: C++ Jul 3rd, 2008
Replies: 17
Views: 2,481
Posted By Duoas
OK, I told you I'd get you an example. I don't want to spend a lot of time finding the libraries to do it and coding one, but I do have an old program I wrote many many moons ago, when I was still...
Forum: C++ Jul 3rd, 2008
Replies: 17
Views: 2,481
Posted By Duoas
I don't know where you read that, but they're wrong. Multiple display pages is a hardware feature, so you can use it no matter what programming language you use.

Give me a little bit to provide...
Showing results 1 to 40 of 263

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC