15,300 Posted Topics

Member Avatar for naya22

MIN and MAX won't really be of much value in your program anyway. First use pencil & paper to find the minimum value of the 5 scores. That will give you a clue how to write the program. You would set the initial minimum value to be the value of …

Member Avatar for Manutebecker
0
3K
Member Avatar for dandan5448505
Member Avatar for vegaseat
0
35
Member Avatar for Gromnie

you can delete score1, score2, ... score5 from the class because they are not needed. You can initialize a vector with 5 integers by using its resize() method [icode]scoreList.resize(5);[/icode] and each element is initialized to 0. So the constructor reduces to this: [code] ScoreChop::ScoreChop() { loScore = 0; avgScore = …

Member Avatar for Ancient Dragon
1
134
Member Avatar for RaDeuX

you can also do it like this: [code] char inbuf[255]; // allocate array of 10 pointers and initialize them all to 0 char* pString[10] = {0}; int i; for(i = 0; i < 10 && fgets(inbuf, sizeof(inbuf), spIn+i) { // allocate memory for the string pString[i] = malloc(strlen(inbuf+1); // copy …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for perfectlover09

What you should have coded is an array of 5 STUDENT structures. Each structure holds the information for just one student [code] typedef struct { int id[5]; char* name; int quiz1; int quiz2; int quiz3; int quiz4; int exam; } STUDENT; [/code] [code] int main() { STUDENT students[5]; // Statements …

Member Avatar for Ancient Dragon
1
228
Member Avatar for The Dude

[QUOTE=sarehu;644957]There's nothing wrong with gambling.[/quote] Not if you are a millionaire or better and can afford to constantly lose. The problem is that most gamblers are not wealthy and can't afford to lose. So, yes, there is a lot of things wrong with gambling for those who don't know when …

Member Avatar for The Dude
1
106
Member Avatar for java_girl

you need to code it something like this -- it has to call fgets() for every line in the file. fgets() only reads one line of the file, not an array of lines. [code] while( fgets(buf, sizeof(buf), fp) != NULL) { // now do something with this line } [/code]

Member Avatar for dwks
0
123
Member Avatar for nnhamane

[URL="http://www.wotsit.org/"]This [/URL]would seem to be a good place to begin your research.

Member Avatar for dwks
0
260
Member Avatar for rishabh2011

>>I am using Dev Cpp for dos programming No you are not. MS-DOS died 10 years ago. What you mean is that you are doing console programming. If you want nice looking gui menus and mouse support something like what you have in your browser then you have to learn …

Member Avatar for Frederick2
0
178
Member Avatar for Q8iEnG

>>I guess all of you know this message.. No I don't. Post the exact error message instead of making us guess. what compiler and os are you using? Learn to use your compiler's debegger so that you can step through the program one line at a time to see its …

Member Avatar for Q8iEnG
0
185
Member Avatar for 13L4D3

Go back to the Microsoft site where you got that compiler and it will have link(s) to tutorial(s) about how to use the IDE. It takes a little practice, but you should bet the basics right away. Just remember, VC++ 2008 Express is NOT Turbo C++, so don't expect to …

Member Avatar for 13L4D3
0
133
Member Avatar for Shadoninja

What operating system? Under MS-Windows you can't achieve that goal with the system() function because it doesn't return anything about the process that was started -- steam.exe in your example post. Instead, use win32 api function [URL="http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx"]CreateProcess[/URL](). The last parameter will be filled in with the information you need to …

Member Avatar for Shadoninja
0
91
Member Avatar for cloverxss

Welcome to DaniWeb. See [URL="http://www.daniweb.com/forums/forum72.html"]these links[/URL]

Member Avatar for zandiago
0
32
Member Avatar for nikhil.laghave

Did you try to use a different name? Is [b]filename[/b] a reserved word in FORTRAN (and is FORTRAN case-insensitive) ? Also, did you make the C function the correct calling convention for FORTRAN? [URL="http://msdn.microsoft.com/en-us/library/aa278672.aspx"]Here[/URL] are the available options.

Member Avatar for ArkM
0
238
Member Avatar for berniecallis

Welcome to DaniWeb where you will find several of us old dinosaurs :) As for your question, please post on one of the Tech Talk boards.

Member Avatar for MakeMoneyOnline
0
82
Member Avatar for Egot.net

Welcome to DaniWeb. Sorry but I had to cut out your email -- against the rules to post them.

Member Avatar for MakeMoneyOnline
0
111
Member Avatar for Jennifer84

>>listView2->SelectedIndices SelectedIndices is not an integer -- its an array of integers. listBox1->SelectedIndices->Count is probably what you want. Did you see the example c++ [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.selectedindices.aspx"]Microsoft code here[/URL] Read the comments carefully. [code] private: void FindAllOfMyString( String^ searchString ) { // Set the SelectionMode property of the ListBox to select multiple …

Member Avatar for Jennifer84
0
202
Member Avatar for Isonis
Member Avatar for nikhil.laghave

The first parameter to fread() must be a pointer. What you are attempting to pass is an integer. Use the pointer & operator and it should fix that. That is inteded to read the binary version of an integer, not the text version. If the file is a text file …

Member Avatar for nikhil.laghave
0
265
Member Avatar for sangham

On client, send the object just like you would send any other blob, then on client recreate it from the blob. Probably something like below. Make sure the class has an overloaded = operator for this to work. [code] // server MyClass object; ... send(socketID, &object, sizeof(MyClass)); [/code] [code] // …

Member Avatar for mitrmkar
0
97
Member Avatar for Code Shark

line 15: does nothing so you might as well delete it. The loop lines 14-25 can be rewritten like this: [code] char word[20]; while(1) { cout << "Enter a word which includes NO i's : "; cin >> word; if( strchr(word,'i') ) { cout << endl << "I asked for …

Member Avatar for Prabakar
0
211
Member Avatar for sambafriends

[QUOTE=sambafriends;647806]Hi, I want the difference between procedural programming language and opps languages with beautiful example ,[/QUOTE] I think you are confusing terms -- oops is not the opposite of a procedural language. An "event driven" language is the opposite of procedural. procedural: the program executed from top down with loops …

Member Avatar for CoolGamer48
0
113
Member Avatar for Alex Edwards

I've had lots of those wow moments -- especially after a few drinks of alcohol. Warning! alcohol and coding don't mix :)

Member Avatar for sciwizeh
0
100
Member Avatar for motiv

My guess is that MS-Windows treats pen events just like mouse events -- there is no difference between the two.

Member Avatar for Ancient Dragon
0
66
Member Avatar for jasonperez

This is something like how to code the program to read each line of the file. [code] #include <iostream> #include <fstream> #include <sstream> using namespace std; ... ... ifstream in("filename.txt"); std::string input; float timestamp,latitude, longitude, altitude; while( getline(in, input) ) { // split it into individual parts stringstream str(line); str …

Member Avatar for jasonperez
0
126
Member Avatar for ctrl-alt-del

Welcome to DaniWeb. >> I have done my very best to keep grammar and punctuation at a proper level In that case you have done a lot more than most of us. Don't worry too much about grammer, few, if any of us, are English majors in college. We don't …

Member Avatar for VernonDozier
0
98
Member Avatar for sambafriends

I have no idea what you want! A program that shows its input data is garbage? What kind of statement is that supposed to be???

Member Avatar for CoolGamer48
0
143
Member Avatar for SonxQ7

cin wants a reference to an integer, and getDay() just returns an int. If you change getDay() to return a reference then readDate() should work correctly. Example: [code] class Date { ... int& getDay() {return m_day;} }; [/code]

Member Avatar for CoolGamer48
0
118
Member Avatar for guy40az

[QUOTE=guy40az;430059]I am using Visual C++ version 6. I need to know how to add a .lib file to a project. I want to add it as a static lib file.[/QUOTE] Project --> Settings --> Link Tab --> change Catetory to [b]Input[/b] then add the library to the [b]Object/library modules[/b] list. …

Member Avatar for guy40az
0
132
Member Avatar for camproject

>>f.write(str_name.GetBuffer(str_name.GetLength()),str_name.GetLength()); This will not help the problem you describe, but you should be using the >> operator for that, not the binary write() function. [icode] f << (LPCTSTR)str_name << "\n";[/icode] Note that you don't need to call GetBuffer() because CString has overloaded the LPCTSTR operator that does similar thing -- …

Member Avatar for mitrmkar
0
122
Member Avatar for SonxQ7

>>or maybe i should just remove the '&', but thought it's a good practice to pass reference params Don't remove the & because open streams must be passed by reference.

Member Avatar for Ancient Dragon
0
83
Member Avatar for The Dude

I doubt the singer would make it on American Idol (or whatever its called in UK).

Member Avatar for dise652
0
45
Member Avatar for Code Shark

[QUOTE=Shadoninja;646691]Why would I go into a C++ reference and go looking for the command when someone like you could clearly help me quicker[/QUOTE] Because, give you bread and you may eat for one day, but teach you how to grow food and you will eat forever. Yes, Narue, or anyone …

Member Avatar for Ancient Dragon
0
188
Member Avatar for Niner710
Member Avatar for mikesharp

When I attempt to do that from a command prompt I get that same error because there is no such thing as "%0...". Where did you get the idea of that %0 from anyway?

Member Avatar for mikesharp
0
395
Member Avatar for jack1234

>> delete[] str; //delete the Candy to avoid memory leak Don't do that because you don't know where str is allocated. The caller may call that function several ways, so its best to leave it up to the caller to delete the string when necessary. Any of the following sanerios …

Member Avatar for ArkM
0
197
Member Avatar for anuizath2007

1) Array elements start counting from 0, not 1. That means the first element of Total is Total[0] and loop counters should count from 0 to but not including the number of elements in the array. Example: The loop counters beginning on line 58 should be (and that's how I …

Member Avatar for anuizath2007
0
113
Member Avatar for rahye
Member Avatar for dev.cplusplus

>>It is possible for the ActiveX, to open a choose folder dialog? I don't see why not, as long as the computer is running MS-Windows >>How I send the content(files) to the server? It would seem to be that the transfer process would be greatly improved if you would zip …

Member Avatar for Ancient Dragon
0
181
Member Avatar for jayee_spicyguy

>>No where in the program they have used X. But it has -- its used in the macro Y

Member Avatar for Ancient Dragon
0
81
Member Avatar for 13L4D3

You do not need ODBC. Just open the text file with standard fstream object. Text files do not need connection strings like SQL databases such as MySql. If your looking to learn ODBC, there are tons of c++ classes, some free and some not free. Just google for them and …

Member Avatar for mitrmkar
0
113
Member Avatar for iamthwee

I don't see a proglem with that code snippet. Key loggers have both legal and illegal uses and the code snippet makes no comment about either. The code snippet used perfectly legal and publically documented functions and there is no intent to being sneeky about it.

Member Avatar for ~s.o.s~
0
87
Member Avatar for Shadoninja

[code] int main() { HWND hWnd = GetConsoleWindow(); ShowWindow(hWnd, SW_HIDE); } [/code]

Member Avatar for Prabakar
0
789
Member Avatar for fmwyso

You didn't look very hard did you? [URL="http://www.daniweb.com/forums/thread134017.html"]Click here.[/URL]

Member Avatar for Ancient Dragon
0
222
Member Avatar for zhouj

A c++ compiler will produce errors on that code because in order to overload a function the parameters must be different. In the code you posted both versions of the function have the same identical parameters. So your question is moot because that code can not be compiled.

Member Avatar for vijayan121
0
171
Member Avatar for abhimanyuancha

Oh gee -- that sure took a loooong time to find. [URL="http://www.google.com/search?hl=en&q=how+to+get+ip+address+from+host+name"]Learn to use google[/URL].

Member Avatar for vijayan121
0
660
Member Avatar for l2u

You can look at the [URL="www.datareel.com"]DataReel[/URL] libraries. It is a set of lots of c++ classes/programs/examples that have been ported to both *nix and MS-Windows, and supports all the popular compilers on both operating systems. It has support for client/server architecture, but I don't know if that's what you are …

Member Avatar for l2u
0
191
Member Avatar for C++masterinneed

line 33: buffer is a character array, therefore it will never be < 0 and that while loop makes absolutely no sense.

Member Avatar for Ancient Dragon
0
100
Member Avatar for zhouj

The second version is actually illegal because the object being returned is created on the stack, and that object is destroyed when the function returns, therefore it will not exist and the returned reference will be invalidated. The first version (without reference) is ok because the program will actually duplicate …

Member Avatar for Ancient Dragon
0
173
Member Avatar for NervousWreck

convert all the calculations to floats and it will work. as integer, 1 * 0.2 = 0 because decimals are discarded.

Member Avatar for NervousWreck
0
108

The End.