Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
13
Posts with Upvotes
10
Upvoting Members
10
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
5 Commented Posts
0 Endorsements
Ranked #585
~20.3K People Reached
Favorite Forums
Favorite Tags

35 Posted Topics

Member Avatar for coroshea

You get those results because you base your sorting on the "name" of the month. Well... The months of the year are obviously not in alphabetical order. So thats gonna get quite messy. To get the desired result, you have to sort the months by number, instead of name.

Member Avatar for coroshea
0
279
Member Avatar for anuragcoder

Hi anuragcoder :-) The error is caused by the fact that malloc returns a void*. You can not make an implicit cast of a void* to another type, you have to make it explicit: [CODE] string = (char*)malloc(strlen(str)); [/CODE]

Member Avatar for thunderox
0
11K
Member Avatar for Hyiero

Hi Hyiero The problem is that cin.get(board) does not remove the 'newline' from the input stream. Look at the sticky thread called "How do I flush the input stream?" That should solve your problem

Member Avatar for Hyiero
0
142
Member Avatar for karthik.chopper

The problem is somewhere in your quicksort algorithm. Testing your code with 100 elements, seems to complete. BUT the output is not perfectly sorted. [CODE] Enter the number of elements 100 0 99 0 20 0 1 3 20 3 7 3 5 3 4 9 20 9 16 11 …

Member Avatar for mbulow
0
416
Member Avatar for Hojjat.Mojallal

[code=c] void list::count_delete(int x) { node *Now=first; node *Pre=NULL; if(first->next!=first) { while(--x>0) { Pre=Now; Now=Now->next; } //What is the value of Pre, at this point, if the initial value of x is 1 ? Pre->next=Now->next; delete Now; } //What is the value of Pre, at this point, if first->next == …

Member Avatar for Hojjat.Mojallal
0
377
Member Avatar for SacredFootball

The reason you get error C2440 is in line 19: [code] totalScore = totalScore + tempPtr; [/code] You are attempting to add an int (totalScore) and a memberInfo struct pointer (tempPtr). What you want to do is add the score-member of the memberInfo struct, like this: [code] totalScore = totalScore …

Member Avatar for SacredFootball
0
157
Member Avatar for skips

1) In lines 27 and 28 change < to <= 2) Remember to output an endl at the end of the outer for-loop [code] for(int i=1; i<=length_stars; i++) { for (int j=1; j<=length_stars-i; j++) { cout << " "; } for (int h=1; h<= i; h++) { cout << "*"; …

Member Avatar for skips
0
143
Member Avatar for ableg02

Based on your own idea to use the []-operator (index-operator): Student students[2]; for(int i = 0; i < 2; i++) { cout << "Enter First Name: " << endl; getline(cin,Firstname); students[i].setFname(Firstname); cout << "Enter Last Name: " << endl; getline(cin,Lastname); students[i].setLname(Lastname); }

Member Avatar for ableg02
0
99
Member Avatar for shabbo_03

I have not made any further tests but... c11, c22 and c33 are pointers to cashier-structs (line 9). In line 30-32 you use the indirection-operator (->) to access the cashier instances pointed to, but you never created the cashier instances. c11, c22 and c33 are pointing to some random memory.

Member Avatar for mbulow
0
357
Member Avatar for Rallici

Hi Rallici :-) You should wrap you header-files in 'include guards'... That will probably remove the problem. [CODE] #ifndef HEADER_INCLUDED #define HEADER_INCLUDED //Header content #endif [/CODE] Btw: The 'include guard' in Global.h has a typo. You miss-spell GLOBAL_DEFINE in the first line.

Member Avatar for Rallici
0
242
Member Avatar for new2programming

Hi new2programming :-) Replace \ with \\ in the string. \ is used to put special characters in a string ('\n' is a newline). To put a '' in a string you type '\'. The beeping sound might be caused by the fact that the file can't be found.

Member Avatar for nbaztec
0
107
Member Avatar for Shaida

Hi Shaida :-) When declaring the functions 'hi' and 'name' at the top, you have to end the statement with a ';'. Like this: [CODE] #include<iostream.h> void hi(void); void name(void); int main() { ... [/CODE]

Member Avatar for Shaida
0
2K
Member Avatar for aaronmk2

Hi aaronmk2 :-) I think I have found the reason for your runtime error. Take a look at your remove-function, where you delete the last node in the Que. You extract the string and delete the node but you NEVER set the 'front' and 'rear' to NULL. The next time …

Member Avatar for mbulow
0
136
Member Avatar for Alex_

Hi Alex_ :-) In "Select all smaller than...": *) Why don't you just use 'cin >> it;' to read the number, like you do everywhere else. *) When you find a number smaller than 'it', you push it to the back of the vector v2. But v2 is just a …

Member Avatar for Alex_
0
1K
Member Avatar for mugilan

Hi mugilan :-) The problem is in your if-statements, handling the menu: [CODE] if(transaction_type = 'X') return; if(transaction_type = 'O' || 'D' || 'W' || 'B') break; else cout<<"\n Invalid type. Please try again"; [/CODE] 1) To compare transaction_type to 'X' you have to use the == (equality) operator, NOT …

Member Avatar for mugilan
0
149
Member Avatar for JStarr

Hi JStarr :-) Found three errors in your code: 1) In the top you declare the function initializeArray, but in the rest of the code you call it initializeArrays (Note the 's'). 2) In startlotto your if-statement is supposed to be a for-statement 3) The ';' at the end of …

Member Avatar for JStarr
0
114
Member Avatar for jimJohnson

Hi jimJohnson :-) Sorry to say, but you have got it wrong. f is a recursive function, meaning that the function calls itself. Let's have a look at what happens in this call: [CODE] f('B'); [/CODE] These are the steps in you algorithm. [CODE] f('B') if-statement evaluates to true. f('B' …

Member Avatar for wade2462
-1
92
Member Avatar for etisermars

Hi etisermars :-) The line [CODE] delete [] p; [/CODE] will only delete the array of pointers, not the objects the pointers point to. You will have to handle the destruction of the ClsA-objects yourself. If you don't you will have a memory leak. Have a look at my simplified …

Member Avatar for mbulow
0
138
Member Avatar for blackmagic01021

When shifting the bits you loose the bits that gets "pushed out". You don't rotate the bits. Lets look at your examples (in binary): [CODE] a: 0000111110100000 a << 3: 0111110100000000 a << 19: 0000000000000000 [/CODE]

Member Avatar for mbulow
0
139
Member Avatar for ferenczi

Hi ferenczi :-) Take a look a close look at your insertEdge-function. In particular the content of the else-statement. Consider what happens in the while-loop. While the incList-pointer is not NULL, you make it point to the first elements next-pointer. When the while-loop completes the incList-pointer will always be NULL. …

Member Avatar for ferenczi
0
114
Member Avatar for broli100

Hi broli100 :-) Give this a try: [CODE] RECT rct; rct.left = 20; rct.top = 20; rct.right = rct.left + 30; rct.bottom = rct.top + 100; InvalidateRect(NULL, &rct, 0); [/CODE] LPRECT is short for "Long Pointer to RECT".

Member Avatar for broli100
0
106
Member Avatar for aleX_X

Hi aleX_X :-) I have not solved the problem for you, but I think I have figured out what is wrong. First of all I've found a couple of bugs in your code: 1) In your main-function, take a look at this code: [CODE] botx=mech.bot.getx(); boty=mech.bot.getx(); [/CODE] Erhm... Bot-Y = …

Member Avatar for NathanOliver
0
226
Member Avatar for maryam ahmad

The reason you get the 'messy' output is that you add 32 to all char's with a value less than, or equal to, 90. That works just fine for the alphabet but when you reach the 'string terminator' ('/0') things go bad. /0 simply has the value 0. You end …

Member Avatar for maryam ahmad
-1
142
Member Avatar for dflatt

Hi dflatt :-) In your code you are comparing the value of variable c to the values of variables a and x. Those variables probably don't even exist. To compare the value of c to the characters a and x you write it like this: [CODE] if(c <= 'a' && …

Member Avatar for dflatt
0
117
Member Avatar for Sinaru

Hi Sinaru :-) Since I don't know how familiar you are with stuff like this I have too ask: You represent a negative binary number as a positive binary number prefixed with a '-'. Is that your own intentional design or because you do not know the real way to …

Member Avatar for mrnutty
1
187
Member Avatar for ollie60
Member Avatar for ollie60
0
104
Member Avatar for GAME
Member Avatar for mbulow
0
110
Member Avatar for yigster

Are you required to use a two-dimensional array as datastructure? If not I would suggest that you use a 'struct' to create some kind of StudentRecord-datastructure. I have tried to make a rewrite of you code, using a 'struct': [CODE] #include <cstdlib> #include <iostream> #include <cmath> struct StudentRecord { int …

Member Avatar for yigster
0
261
Member Avatar for ollie60

Hi ollie60 :-) There is no need to allocate any dynamic memory like that. You don't need to allocate a new vector. All you have to do is calculate the sum of the values from nodeVec and push it to the back of zMap: [CODE] vector <double> mapNodalData(vector <Vec*> nodeVec, …

Member Avatar for ollie60
0
110
Member Avatar for smcp

Well hello again smcp :-) You actually got the part about operator overloading right. The problem is the keyword 'const'. One important aspect of 'const' is that: a) A non-const object can call both const and non-const functions. b) A const object can call const functions, but NOT non-const functions. …

Member Avatar for mbulow
0
725
Member Avatar for tarheelfan_08

Hi tarheelfan_08 :-) You have implemented you stack as a linked list, but when you push a new element you forget to add the current 'top' to the new element. That is why you only have the last pushed element on the stack. Your current push: [CODE] void Inventory::push(string description, …

Member Avatar for mbulow
0
79
Member Avatar for phummon

Hi phummon You should consider using the std::map to map from a string to an int. A quick rewrite of your class using map: [CODE] #include <iostream> #include <map> #include <string> class FruitCart { public: // Constructors FruitCart(); ~FruitCart(); // Accessors void SetFruit(int a, std::string FruitType); int GetFruit(std::string FruitType); void …

Member Avatar for phummon
0
132
Member Avatar for theblastedfool

Hi theblastedfool :-) Your problem is in the checkpass-function. Let's take a look at the check for a lower case letter: [CODE] for ( int i = 0; i <= length; i++) { if ( pword[ i] >= 97 && pword[ i] <= 122 ) { lower = true; break; …

Member Avatar for theblastedfool
0
109
Member Avatar for smcp

Hi Smcp :) Segmentation fault means that you are trying to read or write memory you do not have access to and that is exactly what is happening in you main-function. You have created two arrays fName and lName containing five elements each. No problem there. In your for-loop you …

Member Avatar for smcp
0
146
Member Avatar for Snapster5

I have not taken a closer look at your code, so i'm not sure what you are trying to do but... There is a BIG problem right here: [code=c] while (At_Bat >= Hit); [/code] IF the condition evaluates to true, you are entering an infinite loop.

Member Avatar for mrnutty
0
92

The End.