Search Results

Showing results 1 to 40 of 440
Search took 0.04 seconds.
Search: Posts Made By: Duoas
Forum: C++ Aug 7th, 2009
Replies: 7
Views: 370
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: Pascal and Delphi Aug 4th, 2009
Replies: 12
Views: 922
Posted By Duoas
johnyjj2 if you really want help, please post your code.

What you've listed so far is nonsense.
Forum: Pascal and Delphi Aug 3rd, 2009
Replies: 12
Views: 922
Posted By Duoas
Whitespace between the keyword end and the period is not significant.

Perhaps you should post more code? It is hard to diagnose what is wrong.

With FPC, you must be sure to have the {$goto on}...
Forum: C++ Jul 21st, 2009
Replies: 13
Views: 1,418
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,485
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 Apr 7th, 2009
Replies: 3
Views: 1,193
Posted By Duoas
The wait() (http://linux.die.net/man/2/wait) function monitors the state of a process, not its I/O streams. What you really want is the poll() (http://linux.die.net/man/2/poll) or select()...
Forum: Pascal and Delphi Apr 3rd, 2009
Replies: 2
Views: 654
Posted By Duoas
In Pascal, a semicolon separates statements (and terminates directives).

So the following is correct:

program Hello; { Semicolon terminates directive }
begin
writeln( 'Hello world!' ) {...
Forum: C Apr 1st, 2009
Replies: 2
Views: 575
Posted By Duoas
I'm sure your instructor has given you much more information than you have given us.

Make sure you review how to open pipes:
man 7 pipe: overview (http://linux.die.net/man/7/pipe)
man 2 pipe:...
Forum: C Jan 31st, 2009
Replies: 1
Views: 437
Posted By Duoas
No.

Automatic variables are freed:

int foo()
{
int a = 42;
int* p = (int*)malloc( sizeof( int ) );

*p = a;
Forum: C++ Nov 20th, 2008
Replies: 14
Solved: Crash Windows
Views: 1,186
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: 517
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,186
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: Pascal and Delphi Nov 16th, 2008
Replies: 9
Views: 1,192
Posted By Duoas
It isn't a bug. Free Pascal is a little more strict about certain things than TP.
Your program should read:

program fred;

type funcparam=function(x:real):real;

function jim(x:real):real;
...
Forum: C++ Sep 24th, 2008
Replies: 4
Solved: Bit String help
Views: 1,586
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,586
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: 808
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: Pascal and Delphi Sep 6th, 2008
Replies: 6
Views: 1,407
Posted By Duoas
What version of TP are you using? My TP4 wouldn't get past the 8+ letter filename.

First, you are forbidden to use reserved words as identifiers. That means unit and in are off-limits.

You must...
Forum: C++ Sep 1st, 2008
Replies: 8
Views: 727
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: Pascal and Delphi Sep 1st, 2008
Replies: 3
Views: 1,210
Posted By Duoas
Argh, I couldn't find a simple example on the web. So, without further ado:

hello.dpr

program hello;
{$apptype console}
uses greet;

var
index: cardinal;
Forum: C++ Sep 1st, 2008
Replies: 8
Views: 727
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: Pascal and Delphi Aug 29th, 2008
Replies: 2
Views: 764
Posted By Duoas
Its full path is given as the first command-line argument. So you will want to add code to check to see if an mp3 file was supplied and autoplay it. How exactly you do it is up to you, but I...
Forum: Pascal and Delphi Aug 28th, 2008
Replies: 8
Views: 2,079
Posted By Duoas
> Maybe even scan the image and set the region pixel by pixel, so we will have a long list of vectorial "lines".
That is actually non-trivial to implement. But there do exist algorithms to do it. I...
Forum: Pascal and Delphi Aug 27th, 2008
Replies: 8
Views: 2,079
Posted By Duoas
I think I understand. You want the actual button itself to have the same shape as the polygon?

You'll have to create a region and assign it to your button.
See the MS Regions documentation...
Forum: C++ Aug 27th, 2008
Replies: 11
Views: 979
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: Pascal and Delphi Aug 26th, 2008
Replies: 8
Views: 2,079
Posted By Duoas
Take a look in the documentation for the TCanvas.Pixels property. (Your button has a canvas). Also look at the OnMouseDown event.
Forum: C++ Aug 22nd, 2008
Replies: 4
Views: 489
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: 705
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: Pascal and Delphi Aug 21st, 2008
Replies: 8
Views: 2,079
Posted By Duoas
If you are going to be using buttons with pixel images (like a GIF) you will need to do pixel-hit testing yourself.

Use the OnMouseDown event's X and Y values (which are relative to the button) to...
Forum: C++ Aug 16th, 2008
Replies: 18
Views: 3,847
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: 771
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: 1,971
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,414
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: 590
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,194
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,622
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,194
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,698
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: Pascal and Delphi Aug 3rd, 2008
Replies: 2
Views: 2,621
Posted By Duoas
I don't use Word, so I can't help... but what you are doing is unlikely to work well anyway because the window class names can change between versions of Word... But I think you should be looking for...
Forum: C++ Aug 3rd, 2008
Replies: 16
Views: 1,829
Posted By Duoas
Right. The va_args don't work with object-types.
Forum: C++ Jul 26th, 2008
Replies: 3
Solved: switch problem
Views: 440
Posted By Duoas
Olvidaste poner conullas al seis. while (producto != '6')
:$

Hope this helps.
Showing results 1 to 40 of 440

 


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

©2003 - 2009 DaniWeb® LLC