- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
37 Posted Topics
Re: Just throwing this out there as a suggestion: Maybe C++ isn't the best option (You didn't mention this as a requirement). If it's just a "basic program" perhaps a scripting language like python might be a better fit. I've never used it but there is the PySNMP library. If you … | |
Re: The guy asked for advice on _C++_ GUI programming. You say "C++ is for rough programming"? What does that mean? C++ is very well suited for GUI programming. Anyone else interested in C++ GUI programming, look into gtk, Qt, or wxWidgets and there are others. I know C# and I'm … | |
Re: Just a general suggestion: When going through your book, practice writing very simple programs based on what you are learning. Never go through a new section without at least writing a few lines from what you've read. Break your problems up into very simple and easy to implement tasks instead … | |
Re: I don't think you should be too worried about which language you learn now. If you have a true passion to be a good programmer and write games, you will learn many languages. Once you reach a certain level of knowledge and ability, learning new languages becomes much easier. You … | |
Re: [code=cpp] string s = "SACRED"; s.erase(3,1); [/code] | |
Re: You need to open the file before you start checking for eof. You should only need num1 and num2. That's what loop are for. Don't forget the { } brackets. It loops like you have the basic code needed. | |
Re: Your comments are excessive. Don't comment things that are obvious. You could safely remove most of your comments. They make the code less readable. Also, when you do use comments, be concise; you don't need complete sentences. When you post C++ code, use code=cpp instead of just code. Sorry for … | |
Re: Adapting from your original post, why not include the serial number in your struct, calling it Drawing, and have an array of those. Something like this maybe: [code=cpp] struct Drawing { int serial_number; int revision; int revision_date; char revision_department; }; Drawing drawings[NUM_DRAWINGS]; drawings[0].serial_number ... drawings[0].revision ... drawings[0].revision_date .. drawings[0].revision_department ... … | |
Re: Why are you including [inlinecode]#include "stdafx.h"[/inlinecode]? | |
Re: [inlinecode]StackType& StackType<ItemType>::operator = (const StackType &right)[/inlinecode] Needs to be: [inlinecode]StackType<ItemType>& StackType<ItemType>::operator = (const StackType<ItemType> &right)[/inlinecode] The other error is the same issue. | |
Re: [code=cpp] choice = getData(number); while (choice < 0 || choice > 7) { cout << "Invalid entry." << endl; showMenu(); choice = getData(number); } [/code] This will simply loop until the user enters a number that is not less than 1 and not greater than 8. I probably shouldn't write … | |
Re: Create a source folder. File->New->Source folder. Call it src and save your file there. Then when that windows comes up when you try to run your program, browse to your debug folder and select the program. | |
Re: My advice isn't much different than the others. I wouldn't be worried about what's next. If you don't have other experience in programming, what you have listed is a lot of cover. There is much more to those things than you probably realize. You should practice writing programs with the … | |
Re: Is this button always at the same location on the screen? I tried to help you before. Anyway, look into the SendMessage function in the windows api and send WM_LBUTTONDOWN/WM_LBUTTONUP. If the display of the button is a standard windows button, you can also find the window handle of the … | |
Re: I use Eclipse ([url]http://www.eclipse.org/)[/url]. It's more popular with Java but works quite well with C++. If you're having trouble with Borland you might consider a switch. You'll have to download Eclipse and then download the CDT for c/c++ support here: [url]http://www.eclipse.org/cdt/downloads.php[/url]. | |
Re: There are many ways but here's one: [code=cpp]string filename = Line1.substr(Line1.rfind("\\")+1, string::npos);[/code] I didn't test this BTW. | |
Re: [url]http://xlw.sourceforge.net/[/url] I've never used it but looking at the repository, it seems to be currently maintained. | |
Re: What exactly are you asking? What enables it? The fact that it is part of the language and someone implemented it. | |
Re: This will be very dependent on how the game renders the image to the screen. If they use hardware acceleration, it could be difficult. Maybe your game has s function that will allow you to get at this data somehow. | |
Re: Me again. [code=cpp] inData.open("c:\\inDatat.txt"); // something wrong here? [/code] | |
Re: I found this for you: [code=cpp] void MarshalString ( System::String* s, std::string& os ) { using namespace System::Runtime::InteropServices; const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(s)).ToPointer(); os = chars; Marshal::FreeHGlobal(IntPtr((void*)chars)); } [/code] | |
Re: [inlinecode]void show_word (string);[/inlinecode] then you have [inlinecode]void show_word (char);[/inlinecode] [inlinecode]char InName; // shouldn't this be string?[/inlinecode] [inlinecode]cin >> InName >> endl; // don't put endl here[/inlinecode] You are also calling show_word from within itself. This is recursive and will never end. | |
Re: Here's some reading for you: [url]http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm[/url] There are many resources available to help you do the research to get this done. Google is your friend. Recursive decent is one popular way. What do you mean by "a certain operation that is not pre determined by the programmer"? If it's not … | |
| |
Re: [url]http://www.fredosaurus.com/notes-cpp/functions/params.html[/url] Google for function parameters "by reference" and "by value". Once you understand that, this question becomes quite easy. | |
Re: What is the name of the header file? If it's firstclass.h, you need [inlinecode]#include "firstclass.h"[/inlinecode] | |
Re: First, your calculation isn't correct. Think about the discount calculation. Second, you can't calculate the cost before you know the quantity and discount. Third, your conditionals checking the quantity need to be reconsidered. They won't work as desired but only require a small change. Finally, you aren't validating the input … | |
![]() | Re: Capitalized variable names are, by convention, constants. I think you are trying to follow your instructions here. It says the constants should be used for "conversion factors". A conversion factor is a constant number for which a value in one unit can be multiplied by to convert it to another … ![]() |
Re: You didn't tell us or give an example of what you know (do you know how to implement functions in any way?) so I'll give you a little example of how you can factor your code out. Place this above main(): [code=cpp] double checkInput(double input) { double newInput; cout << … | |
Re: This isn't so much to help solve your problem but a suggestion. You don't need two different versions for cout and a file. Use an ostream. This will allow you to then direct the the output to any ostream derived object. This includes cout, ofstream, or even to a network … | |
Re: Break the problem down into small tasks. First, you need to find a way to get the first digit and the last digit. There are many different ways you could get these digits. One way might be to convert the number into a string. Once you have the string, there … | |
Re: Consider where you would need to accumulate your overall subtotals and overall taxes. You need to accumulate each of these after each order. | |
[B]Background:[/B] I am developing a library for an existing (network) protocol that frequently changes. I want to develop the library to be compatible with the current protocol and support future changes, while maintaining backwards compatibility. Right now, my concern is about the protocol model. I'm trying to find the best … |
The End.