15,300 Posted Topics
Re: I suppose if you have a program that contains 1,000 lines you should have an int array of 1,000 ints and do something like this [code] int counters[1000] = {0}; int main() { counters[__LINE__]++; cout << "Hello World\n"; counters[__LINE__]++; return 0; }; [/code] __LINE__ is a macro that returns the … | |
Re: what are the errors when you attempt to compile on ACM? | |
Re: BuyRadio is a c++ class object, not a POD (Plain Old Data) type so you can't treat it like that. You must give the class a method that will return the button's state. [code] if( BuyRadio.GetState() == true) { SetNumber = 1; } [/code] | |
Re: Of course its legal -- you just forgot the & symbol after [b]int[/b] [code] int afunction(ifstream& in, int& anumber) { /* Function Body */ }[/code] | |
Re: Are you trying to do this from C++? or from Delphi? If Delphi you are on the wrong board and I'll move it to the correct board. | |
Re: >> need help, with the collection :: collection -construcor Nothing wrong with an empty constructor >> also need help with the copy construcor for collection: With no class data the copy constructor wouldn't do anything either >>i think that the vendor data gets lost somewhere before it can be saved … | |
Re: Are you using ancient Tubto C or Tubro C++ compiler? Those two compilers are sooooo old that they aren't of any value to learn c++. Toss them out and download one of the free modern compilers. [URL="www.bloodshed.net"]Dev-C++[/URL] and Microsoft VC++ 2008 are both good ones. There are others too, such … | |
Re: MFC is Microsoft Foundation Class and the oldest of the three. It is mostly wrapper functions for win32 api functions, and makes windows programming pretty easy. Requires a very good foundation and knowledge of c++. ATL (Active Template Library) is somewhat similar to MFC but revolves around C++ templates and … | |
Re: line 51: That is an ILLEGAL way to declare an array. You must specify its size. lines 57 and 58: What happens if OnRelease() returns -1, as it will in line 46? Answer: crash your program. Where (line number please) do you want to use atol() ? If you are … | |
Re: I suppose one way is the first time you ask allow them to type 'Y', 'N', "YES", or "NO". If they type "YES" then assume the answer to all future questions will be 'Y', and if they type "NO" the answer would be 'N' to all further questions. | |
Re: I see that [url]www.codeporject.com[/url] has several programs. And [URL="http://www.google.com/search?hl=en&q=browser+plugins&btnG=Google+Search"]google [/URL]gave me 654,000 hits! I'm sure whatever the solution it would be specific to the browser and operating system you are using. | |
Re: put it in a library or dll and distribute the .h file with the lib or dll. | |
Re: [URL="http://www.codeproject.com/KB/combobox/drivepickerlist.aspx"]This Drive Picker [/URL]MFC control contains the win32 api function(s) you need to get a list of valid drive letters. All you need is to call GetNumSelectedDrives(). See the explaination in the MSDN and the source code link I provided for how to interpret it. I don't know how this … | |
Re: C# and VB are much better languages than C and C++ for reading Excel spreadsheets. The easiest way to do it in C/C++ is to load Excell and export the data to a text file, manipulate that text file, then input it back into Excel. [URL="http://www.c-sharpcorner.com/UploadFile/ggaganesh/CreateExcelSheet12012005015333AM/CreateExcelSheet.aspx"]Here [/URL]is another (cost $$$ … | |
Re: [QUOTE=isotope;538392]Hi happygeek, I saw the address I put as a reference was <snipped>. I read the rules and I saw it might appear as spamming. I didn't mean to do that, the link was to let a deepening of my work's contents. Should I write the address, without hyperlink? Shoud … | |
Re: I guess what you need to do is make parent->GetDimension() a pure firtual function, which means all children must implement it. [code=cplusplus] class base { // pure virtual function int getDimention() = 0; ... }; [/code] | |
Re: IMO she asked for it because she refused the cop's orders to peacefully sit in that chair. Had she set there and shut up nothing probably would have happened to her. They didn't show the actual beating so we can't say what happened. That cop was wrong in that he … | |
Re: depends on the compiler you are using. Some IDEs will keep the console window open and others won't. | |
Re: line 12 of the class constructor: you might as well just set [b]numbers = 0[/b] because [b]new[/b] does nothing when called with a value of 0. line 22: setNumbers(). What happens when [b]numbers[/b] already has a value? Answer: huge memory leek! line 30: what is that supposed to do? Its … | |
Re: If you get the boost libraries you can put that function in another thread and then have it wake up every XXX milliseconds or so. Don't expect very accurate timeing because that will not happen on multi-process operating systems like *nix and MS-Windows. There are other ways too, some os … | |
Re: >>Does this look right? Close, but its not right 1) line 1: the function is supposed to return a char, not double. So you need to declare it as [icode]char Letter ( double P)[/icode] 2) The function is only supposed to have one argument, not two. 3) You forgot the … | |
Re: >>visual basic c++ There is no such thing :) [URL="http://msdn2.microsoft.com/en-us/library/h2x4fzdz.aspx"]Friend Functions[/URL] | |
Re: Weocome to DaniWeb Rocky. Hope to see you around a lot. | |
Re: First you have to allocate memory for the return pointer myIncomingMessage. line 6 only declares the variable, you can't write anything into it until you allocate memory with malloc(), new, or setting it to point to some statically allocated block of memory. Before doing the read on line 20 you … | |
Re: I don't think that's what he wants. I think he wants a windows hook into the system shutdown function such as ExitWindowsEx(). | |
Re: [URL="http://www.programmers-corner.com/sourcecode/111"]Sample code[/URL], [URL="http://www.htservices.com/Tools/VBandC/SerialCommunications.htm"]tutorial[/URL], and other [URL="http://www.google.com/search?hl=en&q=vb6+serial+communications"]helpful links[/URL] | |
Re: I'v had similar problems and the solution was to uninstall and unregister the ATL COM program then reinstall / reregister it. | |
Re: The problem seems to be nested includes. Each header files includes the other header file, so neither header is completly processed before the class is used in the other header. To avoid that problem predeclare the class. See the example below Second: stdafx.h is not to be included in header … | |
Re: I'll bet my boots that you compiled the program for DEBUG. Change the setting to use RELEASE and it will probably work ok. How to change from debug to release depends on the version of the compiler you are using. If you already compiled for release then there couild be … | |
Re: line 46 writes the same array to the same file 12 times. And the use of the asterisk on that line for [icode]*ArraySize[/icode] is also illegal because ArraySize is not a pointer. Even removing the asterisk its still wrong because you don't want [icode]sizeof(ArraySize)[/icode] because you already know the array … | |
Re: We live in a capatilistic (sort of anyway) society. CEOs should get whatever companies are willing to pay them, even if its millions of $$$ and lots of benefits. | |
Re: See [URL="http://www.cprogramming.com/tutorial/const_correctness.html"]this tutorial[/URL]. | |
Re: You need two arrays, the first is an array of integers that has the load terms and the second is an array of floats with the load amounts. There are other ways to do it but I doubt you have learned structores and c++ <vector> yet. Exactly how to read … | |
Re: Welcome to DaniWeb Bushido. I live just across the river near Belleville Illinois. Hope you can hang around a lot. | |
Re: >>The program's suppose to generate 50 random numbers It isn't -- its generating 255 random numbers. line 63: That is doing integer arithmethic because both the numberator and denominator are integers. If you want decimal places in the result of the division then you have to convert them to floats … | |
Re: See [URL="http://gcc.gnu.org/ml/java-patches/2003-q1/msg00358.html"]this thread[/URL]. Looks like you have to define socklen_t yourself. | |
Re: First DJ you should know that MS-Windows programming is not really for beginning programmers -- you should (must) have a good working knowledge of the entire C language, well most of it anyway. c++ is not required. No MS-Windows tutorial will teach you that. The tutorial that John posted is … | |
Re: It looks like it should work. Use your compiler's debugger and set a break point on that return statement then when the program gets to that point you can inspect the value of all the variables. If you don't know how to do that then just put some cout statements … | |
Re: [QUOTE=cosmos22;538518]How would I declare the delete file function, [/QUOTE] just [icode]#include <windows.h>[/icode] If you don't have that installed on your computer then you can't use that function. Use the standard C function [b]remove()[/b] instead. | |
Re: [URL="http://www.demo2s.com/Tutorial/C/0460__time.h/Catalog0460__time.h.htm"]tutorial[/URL] | |
Re: Post a link in Website Reviews and people will help you out. Other than that, I have no idea how to help. | |
Re: This is really an assembly language problem so I moved the thread from C to assmelby boards. | |
Re: win32 api functions: FindFirstFile() and FindNextFile() will do that for you -- you don't have to resort to interrups. [URL="http://www.daniweb.com/code/snippet370.html"]Here[/URL] is a c++ way of doing that. BTW C++ is NOT required to use those functions If you are using ancient MS-DOS compiler such as Turbo C or TurboC++ then … | |
Re: >>I'm not able to respond to your posts lately What posts are you talking about ? I don't get emails at all (normally) and I respond to posts all the time. Its pretty easy to find the threads you have participated in. | |
Re: is the file in the same director where the *.exe is located ? If not then your program can't delete it because the program doesn't know where to find it. And you don't have to use the system() function to delete a file -- just use [URL="http://www.hmug.org/man/3/remove.php"]remove[/URL]() function. | |
Re: Read the file line-by-line. Do not use eof() because it dosn't work the way you would think. [code] string line; fstream in("filename",ios::in); while( getline(in,line) ) { // blabla } [/code] | |
Re: line 3: should be <fstream> (without the .h extension) line 12: since on line 11 you used ifstream you can use ofstream for the output stream. line 28: incorrect. should be this: [icode]sentence[i] = toupper(sentence[i]);[/icode] delete line 30 because it does nothing but confuse everything. I suspect what you are … | |
Re: search for "sort algorithms" and you will get a lot of help. There are a lot of algorithms, which one were you instructed to use ? The [URL="http://www.google.com/search?hl=en&q=bubble+sort"]Bubble Sort[/URL] is probably the easiest to code. | |
Re: dbx files are Microsoft Outlook files. How do you want to access them -- via computer programming language such as C or C++ ? such as do you want to write a computer program that accesses those files ? Your answer to that question will determine where I should move … |
The End.