User Profile
Collapse
-
C++ natively, you can not create GUI applications - but must use OS specific libraries. For example, under windows, you have win32, MFC, & .NET and unix you have lots of different toolkits and libraries. If you want to stick to unix, like I said there are lots out there, some good, some better. I'm sure someone has enough experience to suggest one. -
strtok is the beast that you are looking for and it is used in a similar fashion. referenceLeave a comment:
-
From what I can remember, developing under Win32 is a lot like developing in C/C++. If you want something done you can do it but you are on your own to remember what calls need to be made prior and afterwards. So MFC is a derivative of the Win32 API, making GUI applications a bit easier to use and develop with. As to your other question, of course; however, my experience with Win32 API is limited so I am not completely sure if there is anything...Leave a comment:
-
Do not forget, if you are going to use the "new" operator, it must be accompanied with the "delete" operator as well. Otherwise, memory leaks can occur.Leave a comment:
-
Why store the lines read from the file and then loop through the array? You could very well just grab each line, parse it and store the data needed and move to the next line of the file.Leave a comment:
-
I agree, as if I wouldn't though come on. One thing to remember, especially when using sockets and transferring data over a medium is you can not assume anything. Meaning, do not assume that the 3rd packet you sent will be the 3rd packet recieved or the size for that mater too. If anything, I would be more concerned about the integrity of the data than how many packets it took to get from 1 node to the other. That is, if I was concerned about...Leave a comment:
-
fgets in a loop till you read a newline or EOF. Then you can rearrange the data received each time into a more readable format?Leave a comment:
-
I am still learning about sockets myself but you seem to be making some assumptions that I have learned you shouldn't. Just because you specified a packet at whatever size, does not mean that is what is being sent out. Your buffer, which you seem to understand is what your computer sends/recieve packets to/from has a limit as well. To add to that, just because you sent a packet does not mean it will be correctly received, even within a LAN its...Leave a comment:
-
-
well if you are truly interested in learning on how to create dynamic arrays in C++, I would suggest researching STL containers . Creating dynamic arrays, such as vectors, lists, deques...etc is much safer and is usually efficient enough for most general purposes. Plus comes with lots of little functions like sort or insert.Leave a comment:
-
you could probably do it with strings or char* otherwise some ambiguous old school C/assembly way i'm sure. Would you consider using registers as a variable?Leave a comment:
-
not knowing the complete story, obviously...and sometimes the case always, if you are on a deadline why just use the infamous ping. you can specify how big the packets are and how many you want to send.Leave a comment:
-
yes but using maps for example, will result in less coding, easier implamentation through this massive container. it could even allow someone to be creative and only load certain ranges of words and leave the rest in a file. creating a link-list and iterating through memory addresses can be time consuming. that is all.Leave a comment:
-
The problem with link-lists would be that there would be an excessive amount of memory or storage used. Why, as previously stated: which means not only would there be a potentially a significant amount of redundancy but new memory address for each of those words. Not to mention what that link-list would look like after a few hundred words. As always, there are lots of ways of doing things, I suggest researching associative arrays such as maps,...Leave a comment:
-
I would recommend using qsort just because it is already developed and enhanced and will meet most needs. Plus you won't have to create anything crazy or complicated.Leave a comment:
-
this function will only work copying to a char*, NOT to a string data type
Code:strcpy(char* destination,const char* source)
Leave a comment:
-
would it not be more efficient to traverse known directories or at least look for certain directory names and files to open rather than guessing file names and such. I would look at, this and that should of give you a good general idea if not solution to your problem. As for your current problem, my suggestion is to start small and work your way up. There have been numerous times where I would write code and not test it, thinking it is straightforward...Leave a comment:
-
well dereferencing a null pointer is the least of your troubles. my experience with binary tree's is limited, but if I were in your situation... I would think of a binary tree as a triangle and would "rotate" the triangle. Thus making node->right the top dog and node->left to node->right. then create a function that would restructure my binary tree. Of course there is always google, and I'm sure other people have been in the...Leave a comment:
-
pretty much, you answered your own question. You have 2 binary trees pointing at the same thing. so like an algebraic expression, what you do to one side you must do to the other. otherwise, when the unmodified binary tree goes to a pointer that is no longer valid, undefined behavior is the result. undefined behavior quite literally meaning formating a computer hard drive to quietly aborting the program. if you wonder why this is, i believe...Leave a comment:
No activity results to display
Show More
Leave a comment: