Forgot your password?
Sign in with
Chapters and Sections
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View VB.NET questions
View SQL questions
View ASP.NET questions
All Message Boards...
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Design and Architecture
C / C++ / MFC
ATL / WTL / STL
Objective-C and Swift
Hardware & Devices
Hosting and Servers
.NET (Core and Framework)
Silverlight / WPF
Site Bugs / Suggestions
Spam and Abuse Watch
The Insider Newsletter
The Daily Build Newsletter
Most Valuable Professionals
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
What is 'CodeProject'?
Ask a Question
Bugs and Suggestions
Article Help Forum
Comments by Greg Utas (Top 37 by date)
5 for citing a relevant article.
You need to pass user_in to your user_input function, the same as you pass it to your length_input function.
EDIT: Most (or all) of the errors that you get when compiling are because user_input is returning a char, which you then try to assign to a char array.
It was actually submitted before the previous response, or at about the same time, and then edited. You've got some serious issues, bud.
EDIT: You didn't like the previous response either, so it makes no difference. I notice you didn't downvote OG's canned response, troll.
5. You're more observant than me, who failed to notice that those are in the "hello" function!
This would certainly cause it, and anyone doing this probably has lots of other bugs too.
I know nothing of the framework you're using, but it looks like each of these things being cast as a HWND could be added to a vector when created, so that you could run through the vector and close them later.
But then how does the _first_ user log in?! :)
Thus my suggestion :)
Before doing anything, buy a laxative for whoever wrote these specifications.
I have no experience with C#, but with winsock2.h (C/C++) you have to call WSAStartup before doing any network stuff. Is something similar required in C#?
Even if it were properly formatted, that code would still be crap. That final printf is a clue, but I'm not sure I believe it. For one thing, j is a write-only variable.
I don't think you've even entered your entire homework assignment. It should start with a specification of what the program is supposed to do, not which C++ language features it's supposed to use. Without a specification, you have to make one up yourself, and no two students will end up even trying to solve the same problem.
Maybe someone else can help you with this. I've never used MFC because a console application is more appropriate for what I do. I did make note of an interesting post, however, that mentioned a GUI library that is multi-platform. I have no experience with it, but perhaps it would be of help: https://www.wxwidgets.org/
Edit: Unless you're locked into VS2010 for your job or something, I hope you realize that you can download the "Community" edition of VS2019 or VS2017 (which is what I'm using, if you can still find it). It's free and better than VS2010.
I've never done it. You need to decide which MIDI application is best for you and take it from there. For example, I have Sibelius, which is primarily for sheet music but also handles MIDI. And I have external synthesizers. But I've never felt the need to generate a .wav from MIDI.
Well, I did an online search, and this was the first thing that came up:
Sometimes I say things that are too black & white. :)
There are probably servers that use GC, but it can be risky. I would use C++ for a serious server, and it doesn't have GC. There's little difference between clearing a reference and also freeing the underlying memory without waiting for GC. When someone forgets to clear a reference or delete an object, ideally you want to detect the memory leak and correct it. I've written an article, Robust C++: Object Pools, about how to do this in C++. But I don't think what it describes could be done in Java.
Yes, GC uses CPU time, and usually more if the system is busy. So you're right, it affects latency. Which is why serious servers don't use it. But there's little you can do about it.
Right! Not sure what I was thinking.
Yes, the heap will look like a sawtooth wave because of garbage collection.
If there is CPU time to spare on the server, then how could there be a bottleneck? The exception would be a server that is, say, disk-bound, waiting for disk reads (of images, for example) to complete.
while (i < arr.Count)
Or switch to C/C++, which doesn't enforce array boundaries! /sarc
An undertaking of very dubious value. 99% of the time it's more useful to convert C (or poor C++) into good C++.
I don't actually use Java, but it looked enough like C++ that I thought I could answer. If the index is random, then I assume it would sometimes be out of bounds, in which case I believe Java would raise an exception. Is this what happens? Also, if you've changed that line of code, please include the new version.
Yes, I came back to look at it again after I recalled the 1+ and realized it was fishy. But by that time, OriginalGriff had sorted it out, so I didn't bother to change my solution.
[Deleted and posted as a solution.]
I forgot to mention making int3 a member of a class, which is another way to fix this. I also added some notes about when to use each approach.
Seriously? You're assigning to my_tree again, even though it's been clearly pointed out that insert returns nothing?
You just have to flip everything: + becomes - and vice versa, ++ becomes -- and vice versa, -1 becomes SIZE and vice versa...
I've never used it. I looked at it and closed my browser page while retching.
I own this book (the first edition, so probably a bit dated) and agree that it's good.
Having only one DLL for this could be a design flaw because it can't support multilingual installations. If you're delivering a single-user application, this may be OK, but even then you've run into a situation where it's causing an issue.
Unfortunately, I have no experience with WinMain and the other Windows-specific stuff in your code. And your code is neither formatted nor commented, so I doubt anyone will want to spend much time looking at it. It seems that both are similar, so I suggest that you step through each of them, line by line, with a debugger, to see where they behave differently.
I have neither, and I can't help beyond what I've said. You need to find the complete source code for this.
It won't work *anywhere* until the missing function is provided. There's nothing wrong with VS2017. It's free and I use it for over 200K lines of code.
If it's a server, it will create a socket per client. That's OK until it enters overload, at which point it should start to reject TCP connections. But *one* thread can service *all* of the IP port's sockets, listening for connection requests and polling (WSAPoll on Windows) the client sockets for incoming data.
[Deleted and resubmitted as a reply to the previous comment.]
I missed that! I just saw the accept() and didn't look further. Goodness, any tutorial that creates a thread per TCP socket knows nothing about building a scalable server.
This isn't a forum for spoon feeding you.
Last Updated 1 Jan 1900
All Rights Reserved.