Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
6
Posts with Upvotes
5
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
Ranked #12.3K
Ranked #2K
~3K People Reached
Favorite Forums
Favorite Tags
c++ x 11
c x 5

13 Posted Topics

Member Avatar for techie929

If you must use char arrays instead of strings you need to use strcpy(char* dest, char* source) from stdlib to assign values instead of the = operator you have now. With strings you could do str="abc".

Member Avatar for shashwat_2010
0
137
Member Avatar for c1979h
Member Avatar for c1979h
0
204
Member Avatar for jprogram

First off you are %ing by the wrong number rand()%y will generate a random number between 0 and y-1. Second your loop is only filling in 39 of the 40 values you have allocated to your arrays. Third (0 rand() % 9) will give you an error because there is …

Member Avatar for craig_ka
0
117
Member Avatar for Takarakujin

If you know ahead of time the maximum number of strings you will input and the maximum length of each string you can make a 2D array of chars as follows [CODE]char arr[max strings][max length]; [/CODE] then you can use [CODE]scanf("%s", &arr[l])[/CODE] to input each string and the same for …

Member Avatar for Software guy
0
81
Member Avatar for johndoe444

Apparently what I've read on another site is that including iostream.h has be deprecated from gcc(3.x) and newer. I believe in the older versions iostream with no suffix used to simply include iostream.h itself so you could include iostream.h in your program with no errors. now all of the declarations …

Member Avatar for craig_ka
0
144
Member Avatar for Slobodino

Have you tried to do anything yet, I'd like to help but I won't do you program from start to finish. It looks like it could be solved using a 0-1 knapsack with slight modification for the heights changing as you pick. If you post some code you're working/stuck on …

Member Avatar for craig_ka
0
130
Member Avatar for gregarion

In most languages integer division returns the floor or rounded down integer so 3001/1000 = 3.xxx which as a rounded down integer is just 3.

Member Avatar for metdos
0
109
Member Avatar for Rmitboy

You are reading a char when you first test for EOF to see if the file is empty and never put that char in your line or add it to the count. Just initialize count_char_line to 1 and set oneline[0] to c before you enter the do loop.

Member Avatar for Salem
0
155
Member Avatar for Schottenhemir

Without going through all of your code I can see that your using >> instead of just > for testing greater than and less than so your miles >> 1000 is shifting your miles int 1000 bits to the right which will always make it zero. Try fixing this and …

Member Avatar for Schottenhemir
0
220
Member Avatar for kjock002

You're second thought sounds correct. Loop inputting a number each time and add it to the sum until the current number entered is 999, then stop input and output the sum making sure to either not add 999 to the sum or subract it off after you break the loop.

Member Avatar for craig_ka
0
76
Member Avatar for wale89

This will solve your collision problem. When a record is added its pNext pointer is allocated and id set to EMPTY, this way you can simply iterate the list til you get to the EMPTY id and insert your new data in this record. [CODE] void insert_to_hash_table(HashTable* ht, Student* record) …

Member Avatar for craig_ka
0
634
Member Avatar for bsdbum

You've included a lot of code that is called and shows that there is an issue, but I'd like to see the function called when option 5 is selected to add a new card. I'd almost bet that the problem is that you're cards id variable is never set so …

Member Avatar for bsdbum
0
446
Member Avatar for Someguynamedpie

When you use a class that you've created you need to make an object of that type in you're main function. [CODE]Pib myPib[/CODE] then test can be called with [CODE]myPib.test()[/CODE]

Member Avatar for mrnutty
0
848

The End.