2,045 Posted Topics

Member Avatar for chess2009

ravenous's solution is the most portable, but if the cctype functions are not allowed in your assignment, use characters in your inequalities: [code] char c = 'd'; if(c >= 'a' && c<='z') //use || to include the capitals c >='A' && c<='Z' etc etc. [/code]

Member Avatar for jonsca
0
150
Member Avatar for Truesteel
Member Avatar for ITHope

It seems like you have two programs copy/pasted here, one inside of the other. That's not going to work. See if you can arrange it into one program. Reread the section in your book on functions as to how they are prototyped, defined, and called.

Member Avatar for ITHope
0
176
Member Avatar for Tuloa
Member Avatar for Craftknight

5/9 is an integer division, which gives the value of 0. Change one or both of them to have a decimal (5.0/9, 5/9.0, or 5.0/9.0) which will perform the calculation with doubles.

Member Avatar for Craftknight
0
99
Member Avatar for Lokril

You need to call your function in main(). Line 14 just creates a local integer value called remainder, which bears no relation to your function. Since z is not initialized, it comes with whatever junk is in there at the time. Your function call will look like [icode] remainder(x,y) [/icode], …

Member Avatar for jonsca
0
144
Member Avatar for efecto

It's getting a bit outdated, but this one [url]http://www.functionx.com/vccli/index.htm[/url] has everything together in one place.

Member Avatar for Ancient Dragon
0
178
Member Avatar for jshoot

Unfortunately, it's a pain (but not impossible by any stretch) to retrofit a complete piece of code to a GUI. How comfortable are you with the GUI toolkit already? (like have you made a "Hello, GUI" with buttons or are you able to display a text file in a textbox? …

Member Avatar for Stefano Mtangoo
0
451
Member Avatar for caltech

Add the functionality in the order that it's listed in the instructions. Make the function. Test the function in main a number or two that you know. Test the function on one number. Figure out how many factors it has. Repeat for all of the other numbers. Diagram out your …

Member Avatar for reemhatim
0
137
Member Avatar for Sundayy

Instead of naming your variables something doesn't make any sense, how about naming them something like totalseconds, hours, minutes, seconds. Also, like one of the prior posters said, you have to calculate them WITHIN the program, not have the user enter the calculated value.

Member Avatar for peter_budo
0
446
Member Avatar for kartikkp

You've chosen the wrong kind of project. Choose "Win32 Console Application" instead of Win32 Application.

Member Avatar for jonsca
0
113
Member Avatar for israruval

[quote]I don't know why you would want to make your own stack class[/quote] Homework?

Member Avatar for mike_2000_17
0
5K
Member Avatar for lexusdominus

Show the line(s) that you are using to put it into the text file. You may be adding endl to the end of the line when you don't want to. If you're then, reading it back into a string, something like getline reads to the end of the line and …

Member Avatar for lexusdominus
0
98
Member Avatar for VasquezPL

[icode] if(token == 1 && line->Contains("System")) [/icode] You had token = 1, which assigns 1 to token, which makes it automatically true (non-zero). Also, & is a bitwise and, && is used for comparison.

Member Avatar for VasquezPL
0
141
Member Avatar for israruval

Vector has push_back and pop_back methods, so just use the end of the vector as the top of the stack. You'll have to peek at the end to get the value before you pop it, though.

Member Avatar for israruval
0
1K
Member Avatar for Derek Elensar
Member Avatar for Muhammadlodhi

Make your decimal to binary into a function that returns a string (with the bits going the proper direction, this is not difficult. Chop up the address string into it's elements, place them into an array or 4 individual variables. Use a cout statement with 4 calls to your function: …

Member Avatar for VernonDozier
0
1K
Member Avatar for cppgangster

Yes, the only way to get it is through the full version of VS. The Win32 API is available on the Express Editions (along with .NET).

Member Avatar for Moschops
0
136
Member Avatar for fsefsef23

[quote]does c++ not support the tiny corner number thing [/quote] Not natively. I'm not sure if you could find a library that would do it in a console app, but it's probably not worth it either way.

Member Avatar for jonsca
0
163
Member Avatar for frank731tr

[quote]i know the c string has to have one extra space for \n [/quote] It needs an extra spot for '\0' the null terminus, not a newline. If you're trying to use a std::string in a C-string context, just use the .c_str() method of it. Assume myfunc takes a const …

Member Avatar for jonsca
0
302
Member Avatar for RobBobSmith

Read in the lines using a while loop and getline and compare them with "label1." Once you find it, read those next 5 values in using a for loop. Once you've done that, break out of the loop.

Member Avatar for jonsca
0
201
Member Avatar for Nickod777

You're not calling your functions anywhere within main(). It's simply outputting your input all in a row, as that's all you've asked it to do. You need to name your functions better. Ave is finding a sum, and out is finding the average. That's confusing to anyone trying to read …

Member Avatar for Ezzaral
0
196
Member Avatar for Dasharnb777

The last valid element of an array of dimension n is n-1 (line 4, you're trying to access the nth element of that particular row)

Member Avatar for Dasharnb777
0
135
Member Avatar for JaviP

Change fee to be of type double (it will fit in a float, but live large, j/k). You'll need to change total also, otherwise whatever you add to it will be truncated. Like Momerath said, the division of two integers will be an integer, so 4/100 = 0 (and 101/100 …

Member Avatar for JaviP
0
623
Member Avatar for alex55

Take in the input as a std::string and use the .c_str() method of the string object to get the const char * representation.

Member Avatar for jonsca
0
108
Member Avatar for Martje

Do you want to capture it in place of a button press (like you would in an instant messenger) or...? What were the instructions in C#, perhaps there's a property of the form that's called something different. There's a property where the keypresses from the textbox are also passed down …

Member Avatar for Martje
0
469
Member Avatar for night2night3

You need to designate that getData is a method of EmployeeDataList, since it's not defined within the class declaration. [code] void [B]EmployeeDataList::[/B]getData(fstream& dataFile) [/code] Then you still need to declare "next" as a member variable of EmployeeDataList to avoid the second error.

Member Avatar for Sky Diploma
0
285
Member Avatar for jacob21

[code] #include <stdio.h> void function1(int a,char c) { printf("This functions parameters were an int %d and a character %c\n",a,c); } int main(void) { int x = 2; char b = 'q'; function1(x,b); return 0; } [/code] Can you be more specific about what you want to know

Member Avatar for jonsca
0
46
Member Avatar for fsefsef23
Member Avatar for jonsca
0
93
Member Avatar for aakashjeyapal
Member Avatar for jonsca
0
48
Member Avatar for geekme

You might be able to get it to run under DosBox. I don't use Linux, so I don't know if it would work under something like Wine or dosemu. You should probably just use the gcc which is in all likelihood part of your distro. As for an IDE, Code::Blocks …

Member Avatar for ravenous
0
173
Member Avatar for jugadengg

[url]http://www.mingw.org/wiki/InstallationHOWTOforMinGW[/url] Grab the latest mingw with that installer and then get the Code::Blocks IDE that doesn't include the compiler (or see if you can configure your IDE to find the new compiler).

Member Avatar for Stefano Mtangoo
0
131
Member Avatar for majyun

Read the entries in using the extraction operator >> (so you don't have to convert from text to numbers, just read right into doubles) I read the text file, but are you saying that there is: [code] Text 1.0 2.0 3.0 4.0 Text2 etc. [/code] because you can extract the …

Member Avatar for jonsca
0
228
Member Avatar for eduard77

You've used vectors in your other threads. Think about things you could do towards this problem with a vector of strings (or even an array of strings, if you wanted to practice those).

Member Avatar for eduard77
0
256
Member Avatar for joeyn

Okay, so you've started to plan out what you need, that's a good thing. Start trying to code it. -Can you make the numbers increase over each row. -Do the counts of the elements in the rows bear any relation to other variables? Plan out what you want with pencil …

Member Avatar for Akill10
0
126
Member Avatar for VasquezPL

Change your event to systemBOXComboBoxMenuItem_Click to systemBOXComboBoxMenuItem_SelectedIndexChanged [code] systemText->Text = systemBOXComboBox->SelectedItem->ToString() [/code] I need to look it up, but it seems like ->SelectedText does not work

Member Avatar for VasquezPL
0
686
Member Avatar for erogol

Both numbers are on the same line, so you only need one fgets call, I think. Then you can get the digits from the string or use sscanf (but that's probably overkill).

Member Avatar for gerard4143
0
4K
Member Avatar for lwb525

The specification says that the sentences are separated by periods. I'm assuming there won't be a space after the period. Keep track of the last character you read, [B]if[/B] it's a period, capitalize the next letter. If there is a space, you'll need to skip over it before capitalizing.

Member Avatar for WaltP
0
2K
Member Avatar for Jutch

It's telling you exactly what the problem is. Look in Form1.h for a missing right brace instead of this file. Think of it this way, when you #include a header file like that, the text is basically pasted in at that point. The compiler found the opening brace in Form1.h, …

Member Avatar for jonsca
0
218
Member Avatar for Zgentry

You shouldn't have semicolons after your function definitions on 102,107,and 131. process() should have a closing brace somewhere. Line 97 will declare a Mortgage object that will be destroyed after process() completes (once you put a closing brace at the end of the function).

Member Avatar for Zgentry
0
142
Member Avatar for VasquezPL

Check your compiler settings and make sure that /clr:pure is not set. Edit: but you probably still need the plain /clr switch since you have the managed code in there

Member Avatar for VasquezPL
0
1K
Member Avatar for hotwheels92

Please use code tags [noparse][code]//code goes here[/code][/noparse] Can you post a few lines of the input file? One thing I noticed is if you have an error with the file, you keep right on processing the data. You need some sort of exit condition or a reprompt of the user …

Member Avatar for jonsca
0
170
Member Avatar for rbduck09

[icode] #include <string> [/icode](you still don't have [icode] #include <iostream> [/icode] listed in your code either). It's likely when you found [icode] string str;[/icode] that "str" was a specific variable from someone's code. How would you declare any other variable that is of type XYZ? Nothing special for strings. It's …

Member Avatar for rbduck09
0
144
Member Avatar for andimiami

[quote]I need to take those individual digits the 1 9 5 6 and make it read as a whole number. [/quote] I remember this from before, but you'll have to clarify what you mean by "make it read a whole number." Like I had said on the other thread, you …

Member Avatar for mrnutty
0
209
Member Avatar for jember

[quote]But still I need another answer. [/quote] Yup, he's right. Nick's been doing this for a "couple" of years. I'm confused as to what you need more answers about?

Member Avatar for jember
0
158
Member Avatar for Jessurider

Contact the company. If they are willing to release the code to you, they will. As it is, no one is going to help you disassemble someone's proprietary DLL.

Member Avatar for jonsca
-2
93
Member Avatar for Sundayy

First, please use code tags [noparse][code]//code here[/code][/noparse]. You've been given a sample output, and your code doesn't match. Try to get your program to produce those phrases verbatim. After that, try putting in all the input steps, and then add in the math. Do it in stages like Ancient Dragon …

Member Avatar for Sundayy
0
168
Member Avatar for KHALIL ASLAM
Member Avatar for plang007

[QUOTE=attefeh]It should be [CODE] if(15 < Total_minutes <= 30){ [/CODE] You used '{' after if which should be "("[/QUOTE] That won't work either [code] if(Total_minutes > 15 && Total_minutes <=30){ } [/code] is the correct way to write it.

Member Avatar for rxlim
0
153
Member Avatar for water_ox

You need to show some effort before anyone is going to help you. Copying/Pasting the assignment into the box is not sufficient. Can you create the skeleton for the program? can you declare the arrays? Do you know how to define a function? Give it a try and post back.

Member Avatar for jonsca
0
223

The End.