15,796,132 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by FreedMalloc (Top 29 by date)
FreedMalloc
13-Jul-23 14:29pm
View
Yes. But also that the field you are using is the one for the current instance of the class.
Graeme_Grant has listed a very good link in Solution 2. I think it explains things far better than I can and also gives other usages for 'this' in C#.
FreedMalloc
19-Apr-23 11:44am
View
Is the item in your inventory named "health" or "health potion"? Those 2 strings are not equal. Perhaps you instead need to change your comparison from equals to contains "health".
FreedMalloc
10-Mar-23 23:56pm
View
First off, all you've done is dumped a bunch of code pasted as text instead of using the code block tool so the formatting/indenting is very hard to follow.
Secondly, you don't show any errors. I'm supposed to take your poorly formatted code and try to compile it myself? I don't think you'll get much help with that.
I would suggest you compile the code. Then take each error one at a time and try to figure it out. The compiler should tell what line and column it doesn't like. I'll bet you can clear quite a few on your own. Then if there are still some you don't understand use the green Improve Question link to show 2 or 3 of those errors along with the relevant code. I think people here will be much more willing to help if you do that.
FreedMalloc
10-Mar-23 18:17pm
View
Above you stated: where 0 means "true" and any non-zero value means "false". Don't you have that backwards? 0 == false, non-zero == true.
FreedMalloc
30-Jan-23 16:26pm
View
Which I did by using his CP contact email in my reply to you.
FreedMalloc
30-Jan-23 16:20pm
View
DOTA (Defense of the Ancients). The new version is referred to as Dota 2. Skins are graphical cosmetic add-ons țo modify a character's appearance - cooler helmets, capes, etc.
I would suggest that @Alex_mochp look at the dota website or perhaps some dota2 forums that discuss skins to find out what they're written in and how to go about making your own. Learning C++ may not help if they're written in a different language.
FreedMalloc
8-Nov-22 11:31am
View
You're very welcome.
FreedMalloc
31-Oct-22 14:48pm
View
Deleted
Like: if ((input_byte >= 0x23) && (input_byte <= 0x75)) to process all values starting from 0x23 through 0x75? Or am I missing something in the question?
FreedMalloc
24-Oct-22 4:15am
View
Rather than post additional information as a new solution please click the green Improve Question link to modify your question.
FreedMalloc
19-Oct-22 17:42pm
View
To what purpose? If it's your project for independent study it makes more sense for you to write the code. It's the only real way to learn how. I'm sorry, but I'm not going to write the code for you.
FreedMalloc
19-Oct-22 16:51pm
View
Randomly pick a starting row and column. Ensure that starting there doesn't run off the edge of the grid, or cross another word. If it does adjust it up or down, left or right until it fits. Or, pick new starting positions.
Start with a grid where each index is empty. Once all words are placed randomly fill in all the indexes that are still empty.
This task was assigned to you. It's part of your grade or you're paid to do it. I doubt anyone on this site will just hand you code for you to turn in.
FreedMalloc
19-Oct-22 16:19pm
View
That's good. It'll make the initial coding much easier. Words crossing each other, diagonals, reversing, greater word counts, etc. can all be added in later iterations one by one if desired once the initial program is working.
FreedMalloc
18-Oct-22 20:13pm
View
Are you writing a Scrabble game or a Word Search game? Scrabble does not start with words already on a grid for a player to find. In Scrabble the players choose words and place them on a 15x15 grid to maximize their score. A word Search game would populate a grid with some number of words and fill the rest of the grid in randomly so a player would search for words in the list.
It sounds like you are writing a Word Search game. Is that correct?
FreedMalloc
25-Sep-22 15:33pm
View
Your main method is pretty close now, it parses the CSV file and creates book objects. What's left is to create the classes that extend the LinkedList and the ArrayList and add the sort methods to them according to your assignment. Add each created book to your new list class instances instead of the lists you have now. Finally call the sort method and print out the results.
FreedMalloc
24-Sep-22 23:59pm
View
It sounds to me that you should create your own list classes that extend the Java LinkedList and ArrayList classes to add the sort methods. That way you can read the CSV file into the your new list classes and call their sort methods to sort the lists. However, I don't have access to your assignment so you should confirm and clarify this with your instructor.
FreedMalloc
22-Sep-22 12:03pm
View
As you're beginning to see, debugging is a very large part of programming. And a big part of that is interpreting error messages. The error message should tell you exactly the line of code where the error occurred. Look at that line and read the error message.
For the exception in main it should be fairly obvious what is wrong. Are you perhaps passing something that is not a string to a function that requires one? What are you trying to do there? Then you need to write the code to do what you wanted to do in the first place.
You didn't state what the error in insertionSort was. But it's probably something similar. Look at the line, read the message. If you're still stuck use the green Improve Question link to post the exact error message and ask your question.
FreedMalloc
19-Sep-22 16:45pm
View
Yes, it's -10. Do you understand why it's -10 and not -9?
If not, read the link in Solution 3 posted by OriginalGriff.
The postfix and prefix operators can be a bit tricky sometimes.
FreedMalloc
19-Sep-22 0:47am
View
Yes. I couldn't remember the name of this article. I should have have thought to peruse your list. It too is worth a 5.
FreedMalloc
31-Jul-22 11:59am
View
Look at this line (Apparently less than symbols are not allowed in comments LT substituted):
int sz = m_buffer_size-m_buffer_index LT size?m_buffer_size-m_buffer_index:size;
C++ operator precedence says it's equivalent to:
int sz = ((m_buffer_size-m_buffer_index) LT size)?m_buffer_size-m_buffer_index:size;
But, is it for your compiler? I've seen some odd behavior when dealing with conditionals in the past.
I suspect this isn't the issue since operator precedence is fairly well understood. But, it was the only line I saw with enough complexity that might explain it.
FreedMalloc
31-Jul-22 11:53am
View
Deleted
Look at this line (again):
int sz = m_buffer_size-m_buffer_index
FreedMalloc
31-Jul-22 11:46am
View
Deleted
Look at this line (again):
int sz = m_buffer_size-m_buffer_index
FreedMalloc
22-Jul-22 1:13am
View
Thank you. I assumed that was the intent. Enclosing the initializer in braces was what threw me. I've not seen that syntax before.
FreedMalloc
21-Jul-22 23:49pm
View
Perhaps my C++ is a bit rusty but, I am not familiar with this construct:
vector<int> A{vector<int>(5,0)};
What does this statement (near code line 12) do?
FreedMalloc
4-Jul-22 11:06am
View
Thank you!
FreedMalloc
4-Jul-22 11:05am
View
@tuns13yahooca, I'm glad I was able to help. Good luck!
FreedMalloc
1-Jul-22 23:11pm
View
Just a quick comment on the format of your question. I would have found it far easier to craft the solution I posted below if your question would have included your actual code instead of links to it. There isn't all that much code and putting it in code blocks would have kept it separate from your question text and test data. As it is I was able to view and understand your code but it was inconvenient and I nearly skipped over this question for that reason. In any case, I hope I helped you out and good luck with your changes!
FreedMalloc
2-Jun-22 22:42pm
View
The problem statement said the weight broke into 5 pieces.
Doesn't that mean A + B + C + D + E = 40?
FreedMalloc
25-May-22 19:10pm
View
What have you tried? What was the output?
Please use the 'improve question' widget to post your code, it's output and indicate in the code where you're stuck.
Many people here are willing to help you but we are not willing to do it for you.
FreedMalloc
21-May-22 22:13pm
View
Have you run the code you've shown here?
For the given input, what is its current output?
What is it supposed to output?
The difference between what does happen and what's supposed to happen should indicate what needs to be done.
I would hazard a guess that it hinges upon the requirement statement: "It initializes the code upon this rule...". If you don't understand that requirement then you need to ask the owner for clarification.
Once you're convinced you know what is supposed to happen based upon a given input and can compare it to what does happen, the code to implement the desired behavior should follow fairly easily.
The debugger is your friend here. Use it to examine the values of your class members when the output is unexpected. What are their values? What should they be? That should show what and where you need to make changes.
After you're clear on the requirement and have run the code if you still have questions then post back here indicating what's wrong and where you're stuck. We'll be happy to help you along, but we won't hand you the solution.
Show More