Forum: C++ Aug 7th, 2009 |
| Replies: 7 Views: 370 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 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 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 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 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 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 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 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 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 Views: 1,186 >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 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 Views: 1,186 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 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 Views: 1,586 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 Views: 1,586 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 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 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 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 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 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 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 > 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 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 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 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 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 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 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 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 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 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 Views: 1,414 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 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 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 Views: 1,622 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 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 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 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 Right. The va_args don't work with object-types. |
Forum: C++ Jul 26th, 2008 |
| Replies: 3 Views: 440 Olvidaste poner conullas al seis. while (producto != '6')
:$
Hope this helps. |