15,300 Posted Topics

Member Avatar for farag

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 …

Member Avatar for Ancient Dragon
0
78
Member Avatar for Infeligo
Member Avatar for Jennifer84

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]

Member Avatar for Jennifer84
0
163
Member Avatar for Squeeker

Of course its legal -- you just forgot the & symbol after [b]int[/b] [code] int afunction(ifstream& in, int& anumber) { /* Function Body */ }[/code]

Member Avatar for vmanes
0
141
Member Avatar for fgn89

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.

Member Avatar for Ancient Dragon
0
154
Member Avatar for C++masterinneed
Re: code

>> 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 …

Member Avatar for Ancient Dragon
0
111
Member Avatar for jeffige

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 …

Member Avatar for Ancient Dragon
0
114
Member Avatar for mrjoli021

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 …

Member Avatar for Ancient Dragon
0
205
Member Avatar for smiles

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 …

Member Avatar for smiles
1
151
Member Avatar for cosmos22

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.

Member Avatar for Ancient Dragon
0
104
Member Avatar for mail2indar

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.

Member Avatar for Ancient Dragon
0
42
Member Avatar for mrjoli021

put it in a library or dll and distribute the .h file with the lib or dll.

Member Avatar for mitrmkar
0
114
Member Avatar for cosmos22

[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 …

Member Avatar for cosmos22
0
148
Member Avatar for farag

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 $$$ …

Member Avatar for abrou
0
115
Member Avatar for isotope

[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 …

Member Avatar for isotope
0
128
Member Avatar for jrivera

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]

Member Avatar for vijayan121
0
102
Member Avatar for The Dude

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 …

Member Avatar for ZZucker
0
129
Member Avatar for cosmos22

depends on the compiler you are using. Some IDEs will keep the console window open and others won't.

Member Avatar for VernonDozier
0
100
Member Avatar for volscolts16

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 …

Member Avatar for Ancient Dragon
0
145
Member Avatar for buffe

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 …

Member Avatar for Nemoticchigga
0
114
Member Avatar for Jboy05

>>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 …

Member Avatar for kjc367
0
117
Member Avatar for Swati_bansal

>>visual basic c++ There is no such thing :) [URL="http://msdn2.microsoft.com/en-us/library/h2x4fzdz.aspx"]Friend Functions[/URL]

Member Avatar for farag
0
276
Member Avatar for RockyOne
Member Avatar for Serunson
0
119
Member Avatar for Nemoticchigga

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 …

Member Avatar for Nemoticchigga
0
161
Member Avatar for msk88

I don't think that's what he wants. I think he wants a windows hook into the system shutdown function such as ExitWindowsEx().

Member Avatar for prushik
0
146
Member Avatar for sheeva

[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]

Member Avatar for Ancient Dragon
0
86
Member Avatar for neomalwimalasen

I'v had similar problems and the solution was to uninstall and unregister the ATL COM program then reinstall / reregister it.

Member Avatar for Ancient Dragon
0
74
Member Avatar for p_conk

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 …

Member Avatar for Ancient Dragon
0
102
Member Avatar for arby11886
Member Avatar for Phlip

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 …

Member Avatar for Nick Evan
0
152
Member Avatar for aus_fas1

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 …

Member Avatar for aus_fas1
0
124
Member Avatar for zandiago

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.

Member Avatar for briansmall
0
396
Member Avatar for dophine

See [URL="http://www.cprogramming.com/tutorial/const_correctness.html"]this tutorial[/URL].

Member Avatar for Dave Sinkula
0
101
Member Avatar for jaffo

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 …

Member Avatar for jaffo
0
224
Member Avatar for Bushido Hacks

Welcome to DaniWeb Bushido. I live just across the river near Belleville Illinois. Hope you can hang around a lot.

Member Avatar for richie513
0
121
Member Avatar for dexter1984

>>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 …

Member Avatar for dougy83
0
115
Member Avatar for winky

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.

Member Avatar for fida hussain
0
159
Member Avatar for Dj Saturn

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 …

Member Avatar for Ancient Dragon
0
106
Member Avatar for Jaycii

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 …

Member Avatar for Jaycii
0
145
Member Avatar for cosmos22

[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.

Member Avatar for cosmos22
0
186
Member Avatar for kunalcrazycoder

[URL="http://www.demo2s.com/Tutorial/C/0460__time.h/Catalog0460__time.h.htm"]tutorial[/URL]

Member Avatar for Ancient Dragon
0
146
Member Avatar for cutebab

Post a link in Website Reviews and people will help you out. Other than that, I have no idea how to help.

Member Avatar for DangerDev
0
164
Member Avatar for haroonob

This is really an assembly language problem so I moved the thread from C to assmelby boards.

Member Avatar for Ancient Dragon
0
73
Member Avatar for haroonob

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 …

Member Avatar for Ancient Dragon
0
178
Member Avatar for mechbas

>>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.

Member Avatar for Dani
0
197
Member Avatar for cosmos22

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.

Member Avatar for Ancient Dragon
0
110
Member Avatar for deadrabit

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]

Member Avatar for Ancient Dragon
0
264
Member Avatar for dkwantee

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 …

Member Avatar for Ancient Dragon
1
88
Member Avatar for ivay14

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.

Member Avatar for John A
0
146
Member Avatar for Susy Raybon
Re: Susy

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 …

Member Avatar for Serunson
0
133

The End.