Posts
 
Reputation
Joined
Last Seen
Ranked #81
Strength to Increase Rep
+15
Strength to Decrease Rep
-3
97% Quality Score
Upvotes Received
211
Posts with Upvotes
196
Upvoting Members
121
Downvotes Received
6
Posts with Downvotes
6
Downvoting Members
6
94 Commented Posts
15 Endorsements
Ranked #99
Ranked #48
~804.30K People Reached
Favorite Tags
Member Avatar for samaru
Member Avatar for kittycat07us

the sizeof() operator returns the number of bytes of memory an object occupies, not the number of digits in a number. So use one loop to fill the array with digits counting as you go, and then another loop to do the multiplication, or use a running subtotal to keep …

Member Avatar for Hassan_39
0
11K
Member Avatar for Yuichi

comment out both of these lines: cout<<queue[0]<<queue[1]<<queue[2]<<queue[3]; in sort() change this:[code] int size=10; nt j,temp,i; for( i= 0; i < size - 1; i++) { for(j = i+1; j < size; j++)[/code] to this:[code] int j, temp, i; for(i = 0; i < lastElement; i++) { for(j = i+1; j …

Member Avatar for bangalore.webguru
-1
4K
Member Avatar for coldkiller

To clarify terminology, I think of the scope resolution operator in C++ as the double colon, ::. I don't see that in Clinton's code, but I may have missed it. That being said: 1) Don't resurrect dead code. If you want to base your code off of this post, then …

Member Avatar for Hariharan_1
1
7K
Member Avatar for sya20

Control statements need: 1) an identifier (if, else, switch, for, while, etc) indicating this is a control statement 2) a condition (or conditions) that must be met for the following body of code to run 3) a body of code to run To write the body of code you generally …

Member Avatar for pass4sureguide
0
411
Member Avatar for chrisschristou

I don't do much programming in Java. But here's how I think about it, though it's bound to be off somewhere. In Java each function is a class. It has a name, declaration, and a body. It is declared using public static void name of function(parameterList) followed by a function …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Megaz221

Why bother with strings or char as a type for choice at all. Why not just have the user enter an integer value not used in the menu to exit, say 6 or -1 or 999 or maybe 1234?

Member Avatar for Muhammad_100
3
14K
Member Avatar for robotnixon

Intinalize sum to zero in convertToDecimal() before you try to add something to it. You never use the values passed to convertToDecimal() in the form of roman. Instead, you ask for additional input in the form of romanNum.

Member Avatar for Edwin_6
0
1K
Member Avatar for iansane

You don't need to put the name of the file to open in quotes unless you hard code it at time of compilation.

Member Avatar for Jaja19
0
17K
Member Avatar for kellnerq

Now convert it to do this: Use a single-subscripted array to solve the following problem. The array should be used instead of all the individual counters. Each array element will represent one of the ranges. Be sure to initialize all the elements of the array to zero before you use …

Member Avatar for Victim_1
0
3K
Member Avatar for zandiago

Sequentially read in a char, a string, and a double. The char goes in one array, the string in another and the double in a third. The index of the array and the array name is the key to accessing any one of items in any array. So when the …

Member Avatar for NathanOliver
0
9K
Member Avatar for Transcendent

Also: ask yourself--- 1) how does getline() know when to stop extracting information from the input stream? 2) What can you do to avoid default behavior, if you want to? All of that information should be in your documentation as well. 3) what is the difference between a line and …

Member Avatar for Lerner
0
287
Member Avatar for Elliott_1

It looks like you are trying to do everything at once without taking the time to learn the details. For example, you can declare variables global before declaring main(), but not after. To make the variables local to main() then use an opening curly brace after declaring main and stareting …

Member Avatar for Lerner
0
136
Member Avatar for shahera.arafat

It means "don't return anything". Similar to empty parameter brackets when declaring/calling functions. It can make code easier to read, particularly if you get into the habit of using only one return statement per function.

Member Avatar for mike_2000_17
0
190
Member Avatar for rayhaneh
Member Avatar for Lerner
0
176
Member Avatar for Sunil_12

Since you have a list3 listed I assume you want to create a third list representing the merged lists, leaving the initial lists intact. So: 1) let curr1 work down list1 2) let curr2 work down list2 3) let curr3 work down list3 4)initialize curr1 and curr2 to be the …

Member Avatar for Lerner
0
684
Member Avatar for jarleking

If you move the ouptut statement outside of the for loops, then you should always print out the lowest value in the matrix. If you want to out put the three lowest even values in the matrix then there are a variety of options. One approach would be to sort …

Member Avatar for jarleking
0
108
Member Avatar for Syafiq_1

There are multiply implementations for what we call strings. One version is C style strings, also called nulled terminated char arrays. You can't compare or display all elements of an array at once using the == or the << operators, with one expcept. Because of the terminating null char, you …

Member Avatar for Lerner
0
2K
Member Avatar for Tycellent

Well, there are many types of strings. In standard C and C++ they are null terminated char arrays, meaning the null char needs to be the last char of the characters stored in the array. These strings can be manipulated by a number of standard functions. std:strings objects are instances …

Member Avatar for Lerner
0
180
Member Avatar for Cowboys1

Looks like you had trouble posting the code. Please try again. Learning to debug is as a crucial aspect to successful coding. If you don't know how, then now is as good a time as any to learn. The options are to learn how to use a debugger, or to …

Member Avatar for Lerner
0
94
Member Avatar for aluhnev

1) No reason to use the key word static, that I can see anyway. 2) Some compiler implementations might default elements in arrays of type int to a value of zero, but I wouldn't rely on it if you are writing code in C++. 3) int arr[150] will contain 150 …

Member Avatar for Lerner
0
710
Member Avatar for Tlotleng

To pass information, and maybe change values in passed parameters where changes are retained outside the current function.

Member Avatar for Neuman
0
279
Member Avatar for aluhnev

The nested loop idea is fine, but many of the details are wrong. First the while loop is not doing anything, so why have it. Second, you are missing a closing brace for one of the loops. Third, can you see boolean values known as true or false? I can't. …

Member Avatar for aluhnev
0
374
Member Avatar for preet4fun

Use a loop to control each row to be printed by using a counter that is increased by 1 each time through the loop. Then within the body of the loop use an output statement to display the word ROW and the row number (which is actually directly related to …

Member Avatar for Gozo Anne
0
9K
Member Avatar for john_hasan

To "optimize" it a little further without getting too technical you could keep track of each prime along the way. Then to check if current number is prime just check to see if previous primes up to the square root of the current number are a factor rather than checking …

Member Avatar for aizam76
-1
3K
Member Avatar for DS9596

Put the nested loop to print out the board in a separate function. When using the smaller board be sure you don't go out of bounds by using indexes relevant for the final board. The only values the board will hold are *, space char, equal sign and an i. …

Member Avatar for DS9596
0
765
Member Avatar for inspire_all

strcpy(c.str,a.str); When you call the above on line 26, c.str doesn't have any memory allocated to it yet. Determine the length of p and q, and then allocate adequate memory to str to hold p, q and a null char. Then call strcpy() as you did and then you can …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for zekesteer

zekester: Here's some additional thoughts. If you find them useful, fine, if not, so be it. Just so you know (I'm sure Duoas already does) there is no need to change the struct declarations into class declarations. In C++ the only distinction between classes and structs is that data members …

Member Avatar for Step-hen
0
2K
Member Avatar for mrnutty

I'd like to say it's a reference to Alan Lerner, who was a playwright and author of the play Camelot, about a utopian mythical kingdom, based on the book "The Once and Future King". But, in reality, it's a phonetic spelling of learner, since there's always something I want to …

Member Avatar for Reverend Jim
0
681
Member Avatar for Wayne.H94

It may be that your compiler doesn't recognize the point of entry indicated by void main(). Try int main() instead. In the past some compilers allowed main() to be declared with return type void, but it was a proprietary extension and not all compilers let you do it that way. …

Member Avatar for owenransen
0
168