1,118 Posted Topics

Member Avatar for David Wang

There are two easy ways: 1. Use [B]ShowMessage[/B]( char * ) This puts up a little dialogue box with your text and an OK button. It causes your application to pause until the user clicks OK. 2. If time is an issue, then call [B]AllocConsole[/B]() somewhere at the beginning of …

Member Avatar for mitrmkar
0
301
Member Avatar for sreehari.rk

Since this is the C++ forum, why don't you just dump sprintf() and use the standard streams? [code=C++] #include <string> #include <sstream> int main() { double b = 3.0000; std::string s; // convert double b to string s { std::ostringstream ss; ss << b; s = ss.str(); } // do …

Member Avatar for Duoas
0
1K
Member Avatar for Jennifer84

Hi Jennifer. You can use the [B]fill[/B] algorithm: [code=C++] #include <algorithm> #include <vector> int main() { std::vector<int> Numbers( 5000, 42 ); // 5,000 '42's. std::fill( Numbers.begin(), Numbers.end(), 0 // Turn them '42's into '0's ); } [/code] Now, if you really are using a vector of vectors (5000 * 5000 …

Member Avatar for vijayan121
0
248
Member Avatar for shellsy

A parameter is a temporary variable created by your routine. For example: [code=C++] void bigger_than_five( int number ) { result = (number > 5); } [/code] In this example, [B]number[/B] is the parameter (variable). [code=C++] int main() { if (bigger_than_five( 42 )) std::cout << "42 is bigger than 5\n"; else …

Member Avatar for shellsy
0
356
Member Avatar for isi4h

Delphi IDEs aren't too fond of compiling units by themselves. What you need to do is: [list=1] [*]start Delphi [*]create a new project [*]from the main menu select Project->Add to Project [*]select the UIRT.pas file [*]from the main menu select Project->Build All [/list] You can then just get the UIRT.dcu …

Member Avatar for Duoas
0
149
Member Avatar for mahest

An EAbstractError occurs whenever an abstract method is called. For example: [code=Delphi] type // This is an abstract class tAbstract = class public procedure overrideMe; virtual; end; // This is also an abstract class tStillAbstract = class( tAbstract ) end; // However, this is not, since it provides methods // …

Member Avatar for Duoas
0
152
Member Avatar for missileh

[URL="http://www.newty.de/fpt/index.html"]The Function Pointer Tutorials[/URL]. Enjoy!

Member Avatar for jephthah
0
143
Member Avatar for jonc

I haven't looked through the QStat sources (and I don't plan to), but if it really is just a plain-vanilla command-line application then you only need to spawn it as a subprocess, and re-route its standard input and output to your application. Look through the docs for [URL="http://msdn2.microsoft.com/en-us/library/ms682425(VS.85).aspx"]CreateProcess[/URL]. Hope this …

Member Avatar for Kevin B.
0
95
Member Avatar for EnderX

To determine which drives are available, their drive letters, and what kind of device they represent: [list] [*][inlinecode]DWORD [b]GetLogicalDrives[/b]()[/inlinecode] [*][inlinecode]DWORD [b]GetLogicalDriveStrings[/b]( DWORD nBufferLength, LPTSTR lpBuffer )[/inlinecode] [*][inlinecode]UINT [B]GetDriveType[/B]( LPCTSTR lpRootPathName )[/inlinecode] [/list] (Yes, the above is in C. Specify the [B]Windows[/B] unit in your using clause to use them. Delphi …

Member Avatar for Duoas
0
1K
Member Avatar for wonder_laptop

The math library is just compiled code. It is in the ~lib/ directory. When you [inlinecode]#include <math.h>[/inlinecode] you are only telling the compiler what the things (functions) in the math library [I]look[/I] like. But that doesn't automatically link those functions into your program. You have to do it with the …

Member Avatar for jephthah
0
95
Member Avatar for sara_84

Hey Sara, I don't mean to be too harsh, but at your current level this is [I]waaay[/I] over your head. It appears that you have been hacking at the above code for some time because it is a mess. If this is a school assignment it might be a good …

Member Avatar for anomalice
0
137
Member Avatar for peaceful_soul

A "batch" is a collection of things (data or jobs) to be dealt with by running a single program once. Hence, a batch processor is a program that will handle batches. A classic example is the old DOS command.com. Rather than type in a zillion commands each time you want …

Member Avatar for alexander()
0
162
Member Avatar for nov_bbt

Miranda has a lot of similarities to Haskell. I can't say for sure that I can help you, but post your question and we'll see. Even if I can't, there are a lot of knowledgeable Haskell folks here that probably can.

Member Avatar for sarehu
0
205
Member Avatar for giriraj

What do you mean by "upload"? If you just want to display the picture, you will have to get a JPEG decompression library (QBasic can interface with DLLs that do this), and you will need to switch to a GUI mode to display it.

Member Avatar for JRB6478@ATT.NET
0
649
Member Avatar for fluidtype

My thoughts exactly. [URL="http://angusj.com/resourcehacker/"]Resource Hacker[/URL] is a great little utility. You should be aware, however, that playing around with another program's resources is not always safe. Well-written programs will handle changes gracefully, but those that make assumptions about their resource data may fail. When you modify the bitmap, try to …

Member Avatar for fluidtype
0
123
Member Avatar for DOrmisher

There's nothing wrong with BC++Builder... What do you mean "make a TImage full screen"? Do you have an image you want to resize to your desktop? Or do you mean that you have a form and you want the image area to grow with the form when you maximize (like …

Member Avatar for DOrmisher
0
157
Member Avatar for kemarS

As far as I understand it (having rarely ever used VC++), a [I]filter[/I] is MS's way of providing hooks into the application's main Window Procedure (which contains the top-level event loop) in order to process specific messages. [URL="http://www.codeproject.com/KB/miscctrl/MessgFiltersCallbackDeleg.aspx"]Here's a useful page I googled[/URL]. You will need to use [B]RegisterWindowMessage[/B] to …

Member Avatar for Duoas
0
88
Member Avatar for sura17

Yes to all. However: [list=1] [*]How do you mean? What colors and where? [*]Again, how do you mean? [*]Constants should be constant..., but a quirk of early Turbo Pascal dialects is retained as an option to make [I]typed constants[/I] pretty much the same thing as initialized variables. You should, in …

Member Avatar for Micheus
0
140
Member Avatar for adrive

Er, it doesn't go against Pascal's philosophy at all. The STL just does things from a different point of view. If you want to push and pop, it should be easy enough to write your own procedures to do that. Keep in mind, however, that Pascal doesn't (yet) have a …

Member Avatar for MoZo1
0
2K
Member Avatar for Aborad

That timer event will not work like you expect. The Int10 is not guaranteed to have any specific value. While it may [I]appear[/I] to work sometimes (just as a fluke of how the stack works), it [I]will[/I] suddenly break and work differently. In either case, you should not [I]enable[/I] the …

Member Avatar for Aborad
0
2K
Member Avatar for ndoe

I'm not sure what exactly it is that you want. XRC is a file format used by wxWidgets programs to store the layout and arrangement of buttons and other widgets on a form. A program that uses wxWidgets can create a form using this resource format. The file is an …

Member Avatar for joshualef
0
133
Member Avatar for JamesX4334

You are on the right track, but you need to think about what each segment should look like. For example, you could use 4 by 3 character grids for each segment, and the numbers as [code] _ _ _ _ _ _ _ | | | _| _| |_| |_ …

Member Avatar for JamesX4334
0
148
Member Avatar for Hockeyfreak889

Let the flame wars begin.... sigh. It doesn't really matter what language you choose to begin. You should be aware, however, that languages like lisp and scheme are [I]functional[/I], which is a different paradigm than [I]imperative[/I] languages like C++ and VB. You have to use different parts of your brain …

Member Avatar for Hockeyfreak889
0
169
Member Avatar for Joatmon
Member Avatar for Nektarios

The check should be to prevent the user of the function from passing in a string that is too long to fit in [inlinecode]st.n[][/inlinecode]. So: [code] /* Make sure the string is null-terminated */ memset( (void *)C.n, '\0', sizeof(C.n) ); /* Copy the string over, leaving room for null */ …

Member Avatar for Nektarios
0
103
Member Avatar for peaceful_soul

If you google the fork() command you'll learn why. [code=C] t_pid pid; pid = fork(); if (pid > 0) { printf( "I am the parent. My child's PID is %u\n", pid ); } else if (pid == 0) { puts( "I am the child." ); } else { puts( "I …

Member Avatar for peaceful_soul
0
114
Member Avatar for atish00

Whenever I want the user to enter an array of elements (and this is pretty common too) I always just ask for an extra ENTER at the end (a blank line). So the program might run something like this: [code] Please enter the elements of the array. Press ENTER after …

Member Avatar for atish00
0
112
Member Avatar for daviddoria

[URL="http://www.cplusplus.com/forum/general/518/"]Link[/URL]. Check out my post at the bottom. (Sorry, I've got lazy fingers today.)

Member Avatar for daviddoria
0
96
Member Avatar for RoryGren

Ah, ye olde rodent... Remember, a (basic) mouse only does two things: move and click (single click, that is). So, Windows and Delphi and whatever else have to make some basic assumptions about how the user will manipulate the mouse to distinguish things like drag and double-click from normal movement …

Member Avatar for RoryGren
0
2K
Member Avatar for kiwihaha

Actually, you've done quite admirably. My score: 1768. A couple notes though: [list=1] [*]main returns int: [inlinecode]int main()[/inlinecode] [*]Don't use system("pause") and system("cls"). Here are some good replacements: [code=C++] void pause() { cout << "Press ENTER to continue..." << flush; cin.clear(); // (assume the user is playing interactively) cin.sync(); // …

Member Avatar for kiwihaha
0
99
Member Avatar for -genESIS-

Use [URL="http://www.cppreference.com/stdstring/strcmp.html"]strcmp()[/URL] to compare the two strings. [inlinecode]if (strcmp( words[j], words[k] ) < 0) { swap j and k }[/inlinecode] The strcmp() function is nice because the operator you use (less-than, equal-to, or greater-than) is exactly the same as it would be if you could put it between the strings …

Member Avatar for -genESIS-
0
183
Member Avatar for fuzzy89

Break it down into its constituent parts: [code] int yi = y - i; int val = row[ yi ]; if (val == x) goto return_false_part; if (val == x - i) goto return_false_part; if (val == x + i) goto return_false_part; [/code] Stick that in the loop, and add …

Member Avatar for Duoas
0
195
Member Avatar for daviddoria

You've got that backwards, bub. What you are saying is that you want your feature even though it wouldn't work or it would break on someone else's computer. Such a functionality doesn't cater to everyone. Just you. Since this is C++, whatever it is you are trying to do can …

Member Avatar for Ancient Dragon
0
93
Member Avatar for EnderX

[B]ShellExecute[/B] will always open the file with the associated program --in your case, with Notepad. Take a look at [B]CreateProcess[/B] instead. This will allow you to specify the program to run and pass as argument the name of the file to open. I don't have the time at the moment, …

Member Avatar for Aborad
0
303
Member Avatar for Jennifer84

You are clobbering a pointer or freeing memory too soon somewhere. Then, when the [B]delete[/B] operator tries to free the memory, you crash. Check that you aren't deleting something twice, or assigning a value to a pointer previously assigned a value with new. If you can't find it, post your …

Member Avatar for Jennifer84
0
178
Member Avatar for sura17

You need a loop. Like [B]repeat[/B]..[B]until[/B] or [B]while[/B]..[B]do[/B]. You can also check your answers using a [B]case[/B] statement.

Member Avatar for sura17
0
88
Member Avatar for nelledawg

That [inlinecode]%*c[/inlinecode] is nonstandard. I suspect that you are trying to get rid of the newline. Instead, get rid of the newline with: [inlinecode]scanf( "%d\n", &my_int );[/inlinecode] Hope this helps. BTW, this is the C++ forum.

Member Avatar for nelledawg
0
181
Member Avatar for abar

Alt-F4 is used by the system to terminate an application. Users expect this. (Don't do things that users don't expect.) You might want to look at the OnClose and OnCanClose events if you just want to do cleanup before the application terminates or to prevent the application from terminating under …

Member Avatar for abar
0
242
Member Avatar for angelie

Hi [B]angelie[/B] and welcome to the forums. We won't give you code here, but we'll be glad to help you with your own code. There are two things you need to think about for this assignment: [list=1] [*]How to convert an ASCII digit character to a number. '0' to 0, …

Member Avatar for Duoas
0
108
Member Avatar for manutd4life230
Member Avatar for Duoas
0
120
Member Avatar for ankitbullu

The correct answer is that the question is absurd. No programmer worth his salt would waste his company's time on some trivia like this. Yes, it is [I]possible[/I] to do an overlapped transpose and paste without using extra memory, but there is no [I]need[/I]. Can you really believe anyone to …

Member Avatar for Duoas
0
110
Member Avatar for rezax123

A .COM file is a 16-bit image file. You'll need a 16-bit compiler and a 16-bit linker. I presume you are talking about an executable file, right? .COM as opposed to .EXE?

Member Avatar for rezax123
0
133
Member Avatar for sfurlow2

[B]zhelih[/B] First off, don't just give people code. The whole point of homework is so that the student has to use his brain. Second off, it doesn't work, because the user can't input the first three numbers properly and it doesn't calculate the average. [B]sfurlow2[/B] Remember, the average is (sum …

Member Avatar for sfurlow2
0
805
Member Avatar for DeepakHemnani

[URL="http://en.wikipedia.org/wiki/Fork_%28operating_system%29"]Link[/URL].

Member Avatar for sohguanh
0
121
Member Avatar for Jboy05

This isn't an IIRC, and no one here is going to respond very well to demands for help. You are very much closer. What you need to do now is two things. Take a look at the available C++ operators and use the correct ones. (The GPA problem is fine, …

Member Avatar for Ancient Dragon
0
115
Member Avatar for ithelp

It is the input. This question has nothing to do with C++. It belongs in the Computer Science forum (which includes Theory of Computation). You might want to read up on [URL="http://en.wikipedia.org/wiki/NP_%28complexity%29"]NP complexity at Wikipedia[/URL].

Member Avatar for Duoas
0
100
Member Avatar for matabor
Member Avatar for tpluscomb

Alas, you've got a couple of serious errors... [COLOR="Red"][B]1) Get a string syscall[/B][/COLOR] When you use the systrap to get a string, the returned string has that NL character there at the end... So if I enter "1 2 3" the returned string is (in C parlance) [inlinecode]1 2 3\n[/inlinecode]. …

Member Avatar for Duoas
0
9K
Member Avatar for nikita_knp

For a simple, Turbo C text editor, I assume that your professor wants just a text-mode, <conio.h>, text editor? The only things you really need to worry about are: [list=1] [*]How is the file stored in memory? As a linked list of lines? Or buffered? (I recommend the first.) [*]What …

Member Avatar for rizwan_aman007
0
160
Member Avatar for DarkDot

The first problem this person had is that he did not comment his code very well. The second problem is that his comments don't match his code. The third (and most important) problem is that he did not write down what he was trying to do before doing anything. For …

Member Avatar for DarkDot
0
5K

The End.