15,300 Posted Topics

Member Avatar for jess_redrose

probably want something like this. The function should return a const char* [code] const char* Stack:peek(void) const { return topPtr->item; } // example calling Stack stack; const char* item = stack.peek(); [/code]

Member Avatar for Ancient Dragon
0
121
Member Avatar for nanodano

[QUOTE=nanodano;272209]Have any of you competed in the topcoder matches?[/quote] Nope. [QUOTE=nanodano;272209] Have you found them helpful?[/QUOTE] Don't know, but I suspose they probably are.

Member Avatar for Ancient Dragon
0
64
Member Avatar for JRM

Microsoft VC compilers are really intended for mediam to large projects. Yes it is pretty complicated to learn, but you can't beat its debugger, object browser, intellsense, and several other features. With single-file programs you will be better off using a simpler IDE like Dev-C++, or a command-line compiler and …

Member Avatar for nanodano
0
148
Member Avatar for linq

Hummmm -- why don't you just use CString's assignment operator? strcpy() is for C-style character arrays, not c++ classes. The code in that link is incorrect -- you can not pass CString to strcpy() like that. You will stumble across quite a few printing errors like that in books because …

Member Avatar for Ancient Dragon
0
97
Member Avatar for linq

[QUOTE=Bench;271977]Reading from a file works the same way as reading from any other istream, such as cin: [CODE]//read up to newline std::string str; std::getline(cin, str);[/CODE] [CODE]//read up to whitespace (after a word or character) std::string str; cin >> str;[/CODE]With files, replace [I]cin[/I] with the name of your ifstream[/QUOTE] and just …

Member Avatar for WaltP
0
21K
Member Avatar for dziugas

The keyboard and screen are treated just like files. There are three files that are always open when your program: stdin, stdout, and stderr are 0, 1, and 2, respectively. stdin is the keyboard, while stdout and stderr are the monitor. [URL="http://www.wlug.org.nz/stdout(3)"]Here[/URL] is more information about them. int 21, 40h …

Member Avatar for Ancient Dragon
0
102
Member Avatar for mattyd

[quote] had a influencial programming professor (Dept. Chair, actually) who would say:"Indenting? Nah, that's a waste of time-- I don't care if its all pretty. It just matters that it runs." [/quote] Tell him he is an idot and has no business trying to teach anything but maybe a basket …

Member Avatar for vegaseat
0
323
Member Avatar for pointers

>>Could u pls write a c progra for this Ok, wrote it in about 30 minutes, but I'm not going to post my solution until you post yours (that works)

Member Avatar for Bench
0
109
Member Avatar for Rashakil Fol

>>You attacked VB programmers in general, implying that their art is "child's play" Isn't it? Any 10 year old child can program in that language. Most [b]real[/b] professional programmer would not be caught dead using VB. But that attitude may change in the future with VB .NET because it can …

Member Avatar for Anonymusius
0
693
Member Avatar for The Dude

I hate boxed instant mashed potatoes -- I refuse to eat them and will not eat in any resturant that serves them. We always have the traditional Thanksgiving day dinner (turkey, mashed potatoes, sweet potatoes, green-bean casserole, cranberries, turkey pie) and I always gain about a ton during that week. …

Member Avatar for mattyd
0
91
Member Avatar for JS1988

what is the purpose of that do loop? Why not just remove it ? And you don't need that switch statement if you put the month names in an array of strings. [code] char *months[] = { "", "January","February", ... "December"} cout<< months[monthnum] <<setw(20)<<year<<endl; [/code]

Member Avatar for JS1988
0
130
Member Avatar for xerA

This is a c++ program, why are you using c-style char arrays. Unless your instructore requires it you should probably be using std::string as input buffer. You do loop is all wrong. Use a while loop instead for better control. [code] std::string inbuf; while( getline(infile,inbuf) ) { // blabla } …

Member Avatar for Ancient Dragon
0
113
Member Avatar for Juggler

you have to give the arran a name [code] player = numPlayers(int [color=red]MyArray[/color][NUMPLAYERS]); [/code]

Member Avatar for HelenHui
0
113
Member Avatar for mhasan_mitul

You need to download the [URL="http://www.microsoft.com/whdc/devtools/ddk/default.mspx"]Windows Device Driver Kit[/URL] Can't help with your driver because I have never written on either. [edit]I see from reading that page you might be too late -- the DDK for Win98 is no longer supported or available from Microsoft. Unless I misread it, that …

Member Avatar for Ancient Dragon
0
105
Member Avatar for mattyd
Member Avatar for mattyd

The number of braces in printShipPos() looks ok to me. [code] srand((unsigned)time(0)); //RNG float shipPos; for(int index=0; index<1; index++){ [/code] two comments: (1) srand() should only be called once throught the lifetime of the program. Best place to put it is near the beginning of main() function. (2) I hope …

Member Avatar for mattyd
0
153
Member Avatar for The Dude

first you need to know what programming language was it written in and for what operating system -- assembly, C, C++, BASIC, VB, pearl, pascal, or any one of hundreds of others. If you don't know, then please post some of the code and someone may recognize the language.

Member Avatar for The Dude
0
48
Member Avatar for sg57

depends on the operating system. MS-Windows and *nix: you can not do that because the os will not permit it unless the address is one which you got from allocating memory using malloc(). in assembly just store the destination address in edi register, source address in esi register, number of …

Member Avatar for Ancient Dragon
0
70
Member Avatar for RichC
Member Avatar for punter

you posted the requirements, you posted the code. Now, please edit your post to use [URL="http://web.daniweb.com/techtalkforums/announcement8-3.html"]code tags[/URL] so that we do not go blind trying to read all that unformatted code. >>I dont really understand what to do next... to match the sample output of this; I think you were …

Member Avatar for Ancient Dragon
0
224
Member Avatar for linq

in the OnButtonAdd() event handler for the button 1. assume m_sum, m_add1 and m_add2 are integer class member variables which were defined using ClassWizard (VC++ 6.0 compiler), just call UpdateData() after setting m_sum = m_add1 + m_add2. [code] void OnButtonAdd() { // move window text into member variables UpdateData(TRUE); m_sum …

Member Avatar for Ancient Dragon
0
110
Member Avatar for CurtisBridges

>>char ArraySize =[11][25]; This is incorrect syntax. >>strcpy(hold, arrNames[j]); variable [b]hold[/b] is defined to be a single char. You can not copy a string to a char variable. >>void Quit(char [11][25]); Function prototype and actual function are different. your compiler will produce [b]unresolved externals[/b] error.

Member Avatar for Ancient Dragon
0
82
Member Avatar for Cyclops

The only online game I have ever played it Blizzard's Diablo II Lord of Destruction. I've been playing for 10 years or so and have beaten the bad guy I don't know how many times. I now have a cheat program that gives my character godly powers so that I …

Member Avatar for BeastOverlordH6
0
637
Member Avatar for The Dude

[QUOTE=sharky_machine;270917] save the paper for NEXT year [/QUOTE] I have never seen anyone actually do that in my lifetime. Remove the paper neatly from the box, fold it up nice, then toss it into the trash can.:mrgreen:

Member Avatar for BeastOverlordH6
0
150
Member Avatar for batista06

you will have to add a little code to getOvertimePay() to make that check. First, check for over 60 hours. If its over 60 then calculate 2.0 rate. If not over 60 then do what the function does now -- you don't need to change that part. Something like this: …

Member Avatar for Ancient Dragon
0
126
Member Avatar for pengwn
Member Avatar for The Dude

[QUOTE=Anonymusius;266202]indeed, I have an AK security off fully loaded in my glove department. When I ride an speedbump you better duck. I mean come on, who has an [b]loaded[/b] gun in his glove departement? What happened with to the believe in society?[/QUOTE] Depends on where you live. What good is …

Member Avatar for Ancient Dragon
0
102
Member Avatar for phuduz

>>if (check = true) you should use == boolean operator here, not the assignment operator.

Member Avatar for may4life
0
82
Member Avatar for mikeallen

you have already coded all the required overload operators. In main() just use them like this [code] int main() { Complex x; Complex y( 4.3, 8.2 ); Complex z( 3.3, 1.1 ); cout << "x: "[color=red] << x;[/color] [/code]

Member Avatar for mikeallen
0
146
Member Avatar for spacecowboy123

use unsigned long intead of int. But first check for the maximum value for your compiler in the file limits.h. The maximum value for an unsigned long on my compiler is 4,294,967,295 -- slightly smaller than the value you want. You may have to go with a 64-bit integer, longlong …

Member Avatar for may4life
0
89
Member Avatar for StatManLV

you are probably using controls and dialogs that are not supported in Win98. Read the system requirements in MSDN for the dialogs/functions you are using. For example, is your dialog using UNICODE strings? If it is, then it won't work in Win98 because that os does not support UNICODE.

Member Avatar for StatManLV
0
72
Member Avatar for hui

[QUOTE=may4life;270687]Here's a working example of how to reverse a string using a function. Hope this helps, good luck! [code] #include <iostream> using namespace std; void ReverseString(char string1[], char reversed[]); int main() { const int MAX = 80; char string1[MAX]; char reversed[MAX]; cout << "Enter your string: "; cin.get(string1,MAX); ReverseString(string1, reversed); …

Member Avatar for may4life
0
288
Member Avatar for paradoxxx

there are only 255 possibilities, so just make an int array 255 and use the character as the index [code] int count[255] = {0} char c = 'A'; ++count[c]; [/code] when done the elemenets of count > 0 is the frequency you want.

Member Avatar for paradoxxx
0
141
Member Avatar for mhasan_mitul

First, you don't need to load the dlls. just include windows.h and you will have access to most of the functions you need [code] #include <windows.h> // your code here [/code] Which functions do you need? I don't know, sorry.

Member Avatar for Ancient Dragon
0
116
Member Avatar for JS1988

[QUOTE=JS1988;270472]Does anyone know how to writea program to print [/QUOTE] Yup. Next question :) create two loops -- outer loops counts backwards from 10 to 1, the inner loop counts forwards from 1 to the value of the outer loop counter. Then print the value of the inner loop counter.

Member Avatar for may4life
0
123
Member Avatar for noxee

>>But if I run the program it still works. You are not running the program that you think you are unless you are using a really really old and ancient compiler. None of the compilers I have seen in recent years will produce an executable program when there are compiler …

Member Avatar for Ancient Dragon
0
59
Member Avatar for Morutea

[QUOTE=Morutea;265863]Hello all, It is my first post :) I want your thoughts on this: Do you feel that because your parents may have supported you when you were younger, that you "owe" it to them to support them now? (Pay the bills they run up etc, just because they did …

Member Avatar for The Dude
0
121
Member Avatar for JRM

>>Do the variable names survive the compilation process? If someone was to read compiled code in raw memory, would they see the variable names? No. Compiled porgrams know nothing about variable names -- they are all nothing more than addresses. Variable names are only for you, the human programmer. >>Also, …

Member Avatar for Ancient Dragon
0
124
Member Avatar for neeven

if you posted the wrong code then you need to post the correct code. We don't care if the code you posted doesn't work. Post the code you know how to do then we can talk about how to complete the assignment. by "mark" do you mean "grade" ? >>the …

Member Avatar for Ancient Dragon
0
143
Member Avatar for gilb29

I don't like the American version of football -- too dull, uninteresting and brutal. European football (what we call socker) is a lot more exciting.

Member Avatar for mattyd
0
66
Member Avatar for Colin Mac

use Explorer to delete the project directories, then in VC++ 2005 IDE Start page click on the project name. You will get an option to remove the project. If there's a quicker method I sure would like to know too.

Member Avatar for Colin Mac
0
88
Member Avatar for balgarath
Member Avatar for Ancient Dragon
0
59
Member Avatar for king13

variable [b]charge[/b] is declared both as a global and as a local variable inside main(). Delete the variable in main() because it hides the global.

Member Avatar for king13
0
993
Member Avatar for mikeandike22

all I see from the original post is a picture that has a stack of CDs next to a few books. Pretty picture, but I don't think it contains anything illegal. maybe the immage was changed since the original post???

Member Avatar for kosmoe
0
192
Member Avatar for Ghost

[QUOTE=Tauren;270024]Umm *Looks to the left*.... *Nods head shakes head questions...?* If you didt get that message then that means Confused[/QUOTE] why answer this year-old thread? I doubt anyone really cares any more. I'm going to close it

Member Avatar for Ancient Dragon
0
364
Member Avatar for The Dude

[quote]There are 299,968,595 people in the United States of America. If everyone in the U.S. lined up single file, the line would stretch around the Earth almost 7 times. That's a lot of people.[/quote] Now compare that with the population of China (1,284,303,702 -- 2002 est). Yet the area of …

Member Avatar for 'Stein
0
145
Member Avatar for slacke

What operating system are you using? That is a [URL="http://unixhelp.ed.ac.uk/CGI/man-cgi?ioperm+2"]linux function [/URL]and not supported in MS-Windows. But if you are using linux then I don't know the answer because I don't have a linux computer available to me where I am at.

Member Avatar for slacke
0
205
Member Avatar for Tart
Member Avatar for DmD

you need to post your code that does not work. One way to do it is use strpbrk() function [code] char text[] = "Hello World"; // filter out 'H' and 'W' letters char filter[] = "HW"; char *p = strpbrk(text,filter); // if p == NULL then text[] does not contain …

Member Avatar for Ancient Dragon
0
132
Member Avatar for rati

depends on the operating system -- *nix or MS-Windows? (MAC I don't know about). I believe there are some boost c++ classes that will make your code portable between operating systems. MS-Windows: FindFirstFile() and FindNextFile() [URL="http://www.daniweb.com/code/snippet370.html"]Here[/URL] is a code snippet that illustrates how to use these functions. *nix: opendir() and …

Member Avatar for rati
0
112

The End.