15,300 Posted Topics

Member Avatar for fruitkiwi

>>void main(void) [URL="http://www.gidnetwork.com/b-66.html"]Read This[/URL] lines 11 and 12: where did you defind MaxNumber and MaxCharLength?

Member Avatar for jephthah
0
191
Member Avatar for Nemoticchigga

>>CWinsockInterface::~CWinsockInterface Sounds like something that you wrote. To my knowledge there is no such Microsoft class.

Member Avatar for Ancient Dragon
0
70
Member Avatar for Brent.tc

1) yes -- see [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atexit.html"]ateixt()[/URL] 2) probably not. 3) No. MS-DOS had terminate-and-stay-resident programs that did something like that.

Member Avatar for Ancient Dragon
0
145
Member Avatar for kv79

[URL="http://www.google.com/search?hl=en&q=pictures+of+nuclear+tests&btnG=Google+Search"]nuclear tests[/URL] Nice movie and music but the tanks appear to be very very ancient.

Member Avatar for kv79
0
150
Member Avatar for lemichelle

[code] int foo( PetInfo* pInfo) { pInfo->petType = cat; // etc. etc return 0; } int main() { PetInfo MyCat; foo( &MyCat ); } [/code]

Member Avatar for lemichelle
0
94
Member Avatar for jephthah

[QUOTE=jephthah;572887]okay, experts, i need help.[/quote] :icon_eek: I think the problem is the way you are opening the file. [quote] [b]a+[/b] Open a file for reading and appending. [color=red]All writing operations are performed at the end of the file[/color], protecting the previous content to be overwritten. You can reposition (fseek, rewind) …

Member Avatar for jephthah
0
285
Member Avatar for Traicey

c++ has other more dependable typecasting. C-style typecasting can let you kill yourself if you don't know exactly what you are doing, such as in this example attempting to typecast to normally incompatible data types. [code] double a = 12.34; char* b = (char *)&a; int c = (int)b; [/code] …

Member Avatar for Traicey
0
23K
Member Avatar for piyush_soni

>>When I just run the loop two times without any statements in them, they just give any >>damn value which may have a large difference upto around 25% !!! If you have optimization enabled and have an empty do-nothing loop then the compile will probably just delete the loop altogether. …

Member Avatar for piyush_soni
0
199
Member Avatar for fallen_prisoner

looks ok to me, except in the cin.getline() lines you should use sizeof instead of hardcoding the number [icode]cin.getline (text1, sizeof( text1 ) );[/icode] And you could declare a const int to define 256 instead of hardcoding it everywhere.

Member Avatar for Laiq Ahmed
0
111
Member Avatar for wsn

Where is function [b]getline()[/b]. It isn't a standard C function so you must have written it yourself. I thought you are supposed to write the new text entered from the keyboard into the file? Your program isn't doing that. And you need to rewind the file pointer back to the …

Member Avatar for Ancient Dragon
0
74
Member Avatar for electromania

1) why use double in the struct since the values in the file are only integers. 2) A linked list would be a better choice because it is easier to add new structs. [URL="http://richardbowles.tripod.com/cpp/linklist/linklist.htm"]Here [/URL]is one of the many tutorials you can find with googler.

Member Avatar for Ancient Dragon
0
98
Member Avatar for Nessie

never ever for any reason use gets(). [URL="http://www.gidnetwork.com/b-56.html"]Here's why[/URL]. >>Could it have something to do with using gets()? Yes. [b]instr[/b] can only hold 9 characters plus the null terminator and you are trying to stuff more than that into it. gets() is scribbling the overflow all over your program's memory.

Member Avatar for Nessie
0
116
Member Avatar for code12

>>but my inner loop for j is working again and agian instead of just working for 3 times. are you talking about function addBlackBook() ? Of course it does because you told it ro run that j loop 500 times (line 56)!

Member Avatar for VernonDozier
0
244
Member Avatar for VernonDozier

>>string subChoice =""; It isn't necessary to provide an initializer for strings because that's the default. Just [icode]string subChoice;[/icode] is sufficient. >> do we ever need to use the "compare" function You use it when you need to know if one string is less than, equal to, or greater than …

Member Avatar for VernonDozier
0
924
Member Avatar for kreyd

In ComplexNumber::ComplexNumber you are supposed to set the values of the class variables to that of the parameters. [code] ComplexNumber::ComplexNumber(double r, double i) { this->realPart = r; this->imagenaryPart = i; } [/code] in main() move the line [icode]ComplexNumber userInput(c1, c2); [/icode] down to after the user has entered the values …

Member Avatar for kreyd
0
187
Member Avatar for jimJohnson

line 35: you need to pass variable grade by reference to that Get_Letter_Grade() can change its value. Then in main() you need to save all the graded in an array so that the GPA can be calculated. line 39: the value of [b]number[/b] is never set to anything so all …

Member Avatar for BlackJavaBean
0
442
Member Avatar for The Dude

Very humerous and very very true. I saw a lot of drunks like that when I tended bar 30 years ago.

Member Avatar for jwenting
0
139
Member Avatar for bramprakash1989

line 4: >> class string give you class a different name because [b]string[/b] is the name of std::string that's in the <string> header file. What compiler are you using? If TurboC++ then trash it and get a new compiler if you can because some of the code you are writing …

Member Avatar for Lerner
0
145
Member Avatar for demroth

The loop at lines 28-32 could be better written like this: [code] int i = 0; while( i < arraysize && infile >> numbers[i] ) { i++; } [/code] line 34: do you know for a fact that the file contains exactly 8 integers? It would be better to pass …

Member Avatar for Ancient Dragon
0
130
Member Avatar for Jennifer84

here is an example that uses stringstream as helper. See [URL="http://www.daniweb.com/forums/thread90228.html"]this thread [/URL]for explaination of line 27. [code=cplusplus] #include <iostream> #include <sstream> #include <fstream> #include <string> #include <limits> using namespace std; int main() { std::string one; int Number = 0; std::string line; std::string two; std::string three; ifstream File("..\\TextFile1.txt"); if(!File.is_open()) { …

Member Avatar for Ancient Dragon
0
206
Member Avatar for arun.gerrard

you have to put the timer code in a second thread then when someone types something in thread1 kill the timer thread. How to construct new threads depends on the operating system.

Member Avatar for Ancient Dragon
0
106
Member Avatar for Ancient Dragon

I have been using the Insert Link button every since I Joined DaniWeb and it always worked perfectly. Until now. [URL="http://www.daniweb.com/forums/post572769.html#post572769"]here[/URL] The above link shows the results. The way I do it is first highlight the words I want then hit the InsertLink round button, copy the URL and finally …

0
63
Member Avatar for knight fyre

If the data contains random-length records or lines then you have no other choice but to use sequential access. As always, there are a few exceptions, such as if you create an index file that contains the offsets to the beginning of each line or record, but probably goes beyond …

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

line 18: >>!cin To my knowlege that can never happen so you might as well delete it. Otherwise you program seems to work ok for me.

Member Avatar for Ancient Dragon
0
113
Member Avatar for zzmgd6

Depends on whether the child process is a console application or an MS-Windows program. Console: just return the int value from main(). MS-Windows: [URL="http://msdn2.microsoft.com/en-us/library/ms644945.aspx"]PostQuitMessage[/URL]() On the parent process side: After calling CreateProcess(), call WaitForSingleObject() then when that returns call [URL="http://msdn2.microsoft.com/en-us/library/ms683189(VS.85).aspx"]GetExitCodeProcess[/URL]() to get the exit status of the spawned program. Note: …

Member Avatar for zzmgd6
0
197
Member Avatar for bramprakash1989

1) Stop spamming this board with all those new threads about the same program. Just continue adding to the thread you already have. 2) Learn to use code tags 3) Learn to format your code better so that you and other people can read it easier. I also made a …

Member Avatar for VernonDozier
0
262
Member Avatar for flash121

use friend functions [code]#include <iostream> using namespace std; class c2; class c1 { public: friend c2; c1() {} private: void SayHello() {cout << "Hello\n";} }; class c2 { public: c2() { p1 = new c1;} ~c2() {delete p1;} void Hello() {p1->SayHello();} private: c1* p1; }; class c3 { public: c3() …

Member Avatar for Ancient Dragon
0
94
Member Avatar for Drake

Functions writtein in C language can be called by almost every other language. For example: most, if not all, the win32 api functions for MS-Windows operating system were written in C language and some assembly. Yet all these functions can be called by every other existing language such as Visual …

Member Avatar for sDJh
0
106
Member Avatar for coolerfantasy

[QUOTE=coolerfantasy;571029]Hi Guys Can Pointers In C Points To The Video Memory And Write A pixels On The Screen Or Calls Bios 10H To Do That , What About That : void far *scr = (void far *) 0xA0000000L[/QUOTE] [QUOTE=coolerfantasy;571856]why allways there is a jerk persion thinks him self have big …

Member Avatar for Narue
0
152
Member Avatar for bramprakash1989

First figure out how to split the string then worry about how to write the overload operator. What kind of string -- character array or std::string? How are you supposed to know where to split the string? Is there something in the string that is supposed to tell you where …

Member Avatar for Ancient Dragon
0
263
Member Avatar for bramprakash1989

why did you put a return in the middle of main() ? Lines 12-19 will never get executed because of that unconditional return on line 11. Just delete line 11 and the reset will be executed.

Member Avatar for Ancient Dragon
0
248
Member Avatar for infernojmd

>>(D/4) + (C/4) This is doing integer arithmetic, meaning all decimals are discarded leaving only the integer portion. try casing to double to see if it fixed your problem -- I don't know whether it will or not [icode] ( (double)D / 4.0) + ( (double)C / 4.0) [/icode]

Member Avatar for vmanes
0
97
Member Avatar for The Dude
Member Avatar for Moheet

>>Hi I am New I want Vb.net help is anyone there In the beginning God created the heavens and the earth. Then he created Adam & Eve, who started having babies, granchildren, great grandchildren, etc. etc. Eventually Bill Gates was born and he became the savior of the computer geeks. …

Member Avatar for Ole Raptor
0
127
Member Avatar for kireol

>> strncpy_s(thevalue,sizeof(thevalue)-1,temp,templength); theValue is a pointer, so sizeof(theValue) is the size of a pointer which is 4 on all 32-bit compilers.

Member Avatar for kireol
0
107
Member Avatar for riprose
Member Avatar for The Dude

He's probably shaking his head because that racket hurts his poor ears. I do that too when I hear that awful racket :)

Member Avatar for jbennet
0
46
Member Avatar for Ramy Mahrous

Army sucks. Go Air Force :) (I'm retired US Air Force if you hadn't already guessed) Manditory military service is good for the soul and for what ails you. Joining a military will make a man out of you. Every young man ages 18-25 should experience at least two years …

Member Avatar for DimaYasny
0
289
Member Avatar for mzdiva041986

From the error number I'd say you are using one of the Microsoft compilers. If that is true you can easily and quickly find out the missing { or } by putting the cursor on one of the brackets and hitting Ctrl+{ or Ctrl+}. This doesn't work so well if …

Member Avatar for mukulbudania
0
124
Member Avatar for deactivated

Or you could use std::string's at() method, but I don't see that very often.[URL="Error: c-project_.c(7,2):Unable to open include file 'stdbool.h"] Read this about it[/URL].

Member Avatar for Ancient Dragon
0
100
Member Avatar for DaveCachia

use a while loop [code] bool done = false; while( !done ) { //show menu and execute switch statements or other stuff } [/code] You can use other kinds of loops too, depending on what you want it to do.

Member Avatar for Ancient Dragon
0
97
Member Avatar for knight fyre

line 32 sets status to something other than 10. That means its value is not 10 when line 40 is executed, so the loop continues. I would use a different variable, such as [icode]bool found = false[/icode] then set it to true when line 30 is executed. [code] bool found …

Member Avatar for Aia
0
311
Member Avatar for Majestics

[URL="http://www.cplusplus.com/reference/iostream/istream/tellg.html"]tellg()[/URL] [URL="http://www.cplusplus.com/reference/iostream/istream/seekg.html"]seekp()[/URL] You can read all about the other fstream methods [URL="http://www.cplusplus.com/reference/iostream/fstream/"]here[/URL] If you are still confused after reading the above links please explain what you are confused about.

Member Avatar for Majestics
0
105
Member Avatar for maheshkumar

I think I know what you want to do -- create a 2d linked list [code] typedef list<TREE> LTREE; list<LTREE> L; [/code]

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

[QUOTE=iamthwee;272901]Me too, but I was cutting chili peppers before and forgot to wash my fingers...[/QUOTE] :mrgreen: :mrgreen: :mrgreen:

Member Avatar for The Dude
0
113
Member Avatar for kartouss

line 7 vijay's function declaration is wrong or just plain convoluted [icode]void copy_string_to_array( char array[N][N], const char* cstr )[/icode] >>I am having a problem for coping the string into a 2d array.. [code] // the following array will hold up to 4 strings, and each string can be no more …

Member Avatar for vmanes
0
5K
Member Avatar for coolbreeze

>>print(grid, rows, columns) Well, where did you declare the variable [b]columns[/b] ? You have to declare variables before they can be used or passed as parameters.

Member Avatar for Ancient Dragon
0
80
Member Avatar for knight fyre

Look at the file in Notepad or some other text editor to see if the contents are what you expect.

Member Avatar for Ancient Dragon
0
97
Member Avatar for steven woodman
Member Avatar for TheOneNOnlyQ

Good god what is crappy code you posted with has no line breaks ???? I was going to add code tags for you but they would be useless the way that code is formatted.

Member Avatar for Ancient Dragon
0
760

The End.