Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
90% Quality Score
Upvotes Received
9
Posts with Upvotes
9
Upvoting Members
8
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
2 Commented Posts
~25.2K People Reached
About Me

Your best friend.

Interests
AI, sleeping, American comics, Japanese animation, football (soccer), video games, and hard rock music.
PC Specs
Macbook Pro 4,1 Mac OSX: Snow Leopard, Windows 7 Professional
Favorite Tags

80 Posted Topics

Member Avatar for LostnC

As mentioned, you were trying to assign an integer to a pointer rather than dereferencing the pointer to store the value.

Member Avatar for deceptikon
0
3K
Member Avatar for asad393

@Gonbe: Why'd you give out an answer? This seems like an assignment, so why not let him/her do the work themselves and post it here if they need additional help?

Member Avatar for Gonbe
0
358
Member Avatar for C++newbie chick

You only set mid once, and that was outside of any loop, so it doesn't update when last or first changes.

Member Avatar for C++newbie chick
0
2K
Member Avatar for Mopikope

Why not use a list of strings rather than a character array? The list class is made for fast insertion and deletion, without you having to worry about shifting values continually.

Member Avatar for Mopikope
0
128
Member Avatar for itzcarol

Your asking the user to enter a grade, then testing the array's data before they even enter any information. Once you declare your array, its data is going to be garbage, so that's what you'll be testing against.

Member Avatar for Labdabeta
0
4K
Member Avatar for dakerao

[QUOTE=NathanOliver;1682830]So in your example a and b are both 10. You add them together and you get 20. Now you want to set a and b to 20 and do it again?[/QUOTE] I think it's more on the line of adding the result of a + b to a + …

Member Avatar for Chilton
0
213
Member Avatar for Vasthor

You have to set c to 0, because it needs to increment until it counts the amount of characters in cols. When it reaches that amount, then you've finished printing one line. As for c += greeting.size();, c is incremented by the amount of the "greeting" since in the previous …

Member Avatar for Vasthor
0
458
Member Avatar for stevo7624
Member Avatar for raptr_dflo
0
133
Member Avatar for cummings15

You could always just test for the student with the longest name, and find the difference in spacing between that name and every other name. In doing so, you can print the correct amount of spaces after each person's name, followed by the list of grades. Good luck. P.S. I'm …

Member Avatar for raptr_dflo
0
151
Member Avatar for New4lyfe

It seems like most of the work is already done. Make some attempt at the code, post it, and we'll give assistance if need be.

Member Avatar for New4lyfe
0
188
Member Avatar for ronthedon

InitWord[50] is invalid, in this case, since your array is actually from 0-49. Also, if you want to copy the word to the struct member, you can use strcpy. Lastly, if you're trying to pass that array to InsertItem, then you'd need to pass a pointer to it and the …

Member Avatar for vidit_X
0
216
Member Avatar for Sunshine2011

There is no pAVec member in your class, and neither was one passed to the member function test.

Member Avatar for Sunshine2011
0
123
Member Avatar for valestrom
Member Avatar for Clinton Portis
0
263
Member Avatar for CrazyMisho

If your list is generic, then you wouldn't necessarily need to specify the particular class object would you? What do you have there that is a substitute for the name of a type?

Member Avatar for Chilton
0
147
Member Avatar for johnnyboyslim

It means that the variable direction is default initialized with the character 'A', if you don't pass a character as an argument to the function. If you do, it replaces that value with the one the caller (you) provided.

Member Avatar for Chilton
0
63
Member Avatar for Adam Ma
Member Avatar for cherrymae.calma
0
167
Member Avatar for robdb

Your string and list are empty when you test for their size. Also, you've only opened the file. Where did you read from it?

Member Avatar for raptr_dflo
0
534
Member Avatar for maria536

There's a semi-colon after your string. Remove it. Also, separate your variables in output by << operators and not semi-colons.

Member Avatar for maria536
0
190
Member Avatar for sandman64

Your code tags isn't structured properly. Also, I'll give a hint. Work it out by hand first. Assume the first population is 755, for instance, and using what you know about the arithmetic operators, find a way to round to 1000. By finding it for this case, you can work …

Member Avatar for Chilton
0
190
Member Avatar for oscargrower11

In your catch statement, you referred to e but you never used it. Instead of [CODE]cout << "exception handled" << endl;[/CODE] try [CODE]cout << e.what() << endl;[/CODE] That should display the error string that you threw. If you want to specify it as an error, you could use cerr instead …

Member Avatar for oscargrower11
0
166
Member Avatar for DrShroom
Member Avatar for PaulProgramer

You could use an associative container, such as a map, that has unique key values (in your case integers). The container is self-ordering, so by testing the difference between each successive key value (integer), you can find out which integer you'd need to search for next if their difference isn't …

Member Avatar for PaulProgramer
0
222
Member Avatar for efigen

You should pick a better name for your string other than "string", just to be safe. Aside from that, you're indexing your string so each index corresponds to a specific character, in the case of string[7] it'll be 5 and string[8] will be *. If you want 45, you can …

Member Avatar for WaltP
0
101
Member Avatar for aspirewire

In your example, you're neglecting to test if the die rolls on a 6 in your if statement. Also, rather than using [CODE]num < 6 && num > 0[/CODE], try: [CODE]if ((num >= 1) && (num <= 6)) { // rolls on a correct die value }[/CODE] Also, keep in …

Member Avatar for WaltP
0
129
Member Avatar for skiboy209
Member Avatar for raptr_dflo
0
187
Member Avatar for jashbela
Member Avatar for rdhc1330

Make an attempt before asking for help, or ask questions about the language details, so you can get a better understanding.

Member Avatar for mike_2000_17
0
826
Member Avatar for Mark198995

Review the link that was posted before to get a better handling on loops, then try doing your program again.

Member Avatar for Mark198995
0
153
Member Avatar for skorm909

There's some syntax problems with your program that you should handle beforehand. In each of your condition statements, make sure you're using == signifying equals rather than = meaning assignment. Also, cout uses the ostream operator << whereas cin uses the istream operator >>. In addition, it's "cin.get()" rather than …

Member Avatar for raptr_dflo
0
145
Member Avatar for evilguyme

If you're trying to pass the array to the function, you should just pass the name of the array "levelOnePlatform" as the first argument and 50, as the second argument which is its size.

Member Avatar for evilguyme
0
91
Member Avatar for YungSoprano

If you've used "using namespace std;" then putting "using std::cout;" and "using std::cin;" isn't required.

Member Avatar for YungSoprano
0
610
Member Avatar for Chilton

Greetings, I've found [I]Accelerated C++[/I] to be a pretty solid foundation in C++, but with regards to the new standard, does anyone know of a good supplemental text that can keep me up to date with said standard? Any help would be greatly appreciated. Thanks in advance.

Member Avatar for Chilton
0
215
Member Avatar for Zoe123
Member Avatar for eustine

Work on understanding variables and proper syntax before beginning the assignment. Also, to the poster above, please don't provide answers only suggestions.

Member Avatar for Chilton
-3
151
Member Avatar for brynjar

If you would like to return a newly generated "array" from a function, you can create a pointer to that type and dynamically allocate space for the array, within the grav_force function, set its values, then return its address. Ex: [CODE] double* foo(double, double, int&); int main(int argc, char* argv[]) …

Member Avatar for lcordero
0
230
Member Avatar for fsefsef23

Your node has a data area and a pointer, next, in this case. That pointer just holds the address of the node that follows the current one. The node at the end of the list, its next pointer would be set to NULL/nullptr, indicating that it is indeed the end …

Member Avatar for LevyDee
0
179
Member Avatar for turista

Why do you have two main functions? Also, use code tags and check the line the error is identifying.

Member Avatar for Chilton
0
259
Member Avatar for dilequeno

One thing to note is that accumulate's third parameter, 0 in this case, makes your result an integer because the function takes that type as its value. Therefore, the fractional part of your code would be disregarded. Change the 0 to 0.0.

Member Avatar for dilequeno
0
158
Member Avatar for kalingaRHASTA
Member Avatar for King_Alucard

DayOfTheWeek is your class type; you're trying to make it a string variable name as well. Use a different name for the string. Also, [CODE] void DayOfTheWeek::setDay(string DayOfTheWeek) { day = DayOfTheWeek; }[/CODE] DayOfTheWeek needs to be changed, and your get function doesn't store the returned value anywhere.

Member Avatar for Akill10
0
256
Member Avatar for bkoper16
Member Avatar for Chilton
0
110
Member Avatar for jimmymack
Member Avatar for cousinoer5
Member Avatar for taumang

Wasn't the assignment telling you not to use if, or while statements? Also, it asks for you to do this in a function. Following the suggestion given, you can save many lines of code and create a similar function to return the largest value of the three.

Member Avatar for madifemo
-1
235
Member Avatar for shyla

You are trying to define your functions in a function. Check your braces on each one.

Member Avatar for Arbus
0
1K
Member Avatar for SeePlusPlus2

The this pointer is used to refer to the current object being utilized. For instance, if you have an overloaded assignment operator for a class, and you'd like to test whether or not an object is being assigned to itself, that operator is used to check. Based on your code, …

Member Avatar for arkoenig
0
152
Member Avatar for margeaux54

If you know the amount of bytes the type has, and the amount of bits in a byte, unless it's unsigned, the range for int, for example is: 0 to (2^(b * 8) /2)-1 for positive values and -1 to -((2^(b * 8)) /2) for negative values where b is …

Member Avatar for Fbody
0
170
Member Avatar for sosongetsu

Hello. If you've initializing a two dimensional array, then group your numbers as such. In this case, you have three sets of four integers i.e. [CODE]int numbers[3][4] = { {8, 16, 9, 52}, { 3, 15, 27, 6 }, { 14, 25, 2, 10} };[/CODE] Along with this, you don't …

Member Avatar for Chilton
0
171
Member Avatar for sara90

In your if statement, shouldn't those be assignment statements rather than checking equality? Also, temp is an array pointer, so trying to assign another address to it (if that's what you were trying to do) would cause a problem. If you just wanted to copy the string into temp, use …

Member Avatar for Chilton
0
92
Member Avatar for Khoanyneosr

In the instructions function and in the welcome function, you're calling game() without any arguments, when the function is stated to take 5.

Member Avatar for Khoanyneosr
0
280

The End.