15,300 Posted Topics

Member Avatar for certem

You can't do it with the floats or doubles in C/C++ language because of the way they are stored in memory. If you use C/C++ languages and want great internal precision then you will need to use some other math package that will allow it. myVariable.value may be unavoidable.

Member Avatar for John A
0
245
Member Avatar for nehamore

The [b]system[/b] function on line 21 does not return the shell program's return value. You will have to call some other function that spawns processes, such as one of the [b]spawn[/b] family of functions.

Member Avatar for jim mcnamara
0
407
Member Avatar for asifakram

>>i desparately need it within 4 hrs ! I see in my crystle ball that you won't make it :) Your quickest solution is to search this site for other similar questions because that has been discussed several times.

Member Avatar for plgriffith
0
163
Member Avatar for Grub

The push_back() method will create a duplicate copy of the class Catalog, and the class constructor gets called and the constructor opens a file. That means the file gets opened every time push_back is called, and eventually the program will exhaust all available file handles. Why don't you try removing …

Member Avatar for Grub
0
98
Member Avatar for jokerjokerer

I'm glad you found the problem yourself because I for one have no idea what you were trying to describe. Never heard of [b]wofstream[/b] or [b]Codecvt Facet [/b], but I am very familary for MFC's CString c++ class.

Member Avatar for jokerjokerer
0
209
Member Avatar for sir avalanche

Please reference the line numbers in that code when commenting on the code. We are not going to hunt through all that code to search for what you are talking about. For example [b]3. the for-loop of the program either never ends, or is only run once[/b]. Well, exactly what …

Member Avatar for Ancient Dragon
0
107
Member Avatar for technogeek_42

[QUOTE=ithelp;512159]Except for the facts like C++ has more keywords, so int new; will not compile in C++, but it will work without any problem in C.[/QUOTE] you have that backwards. the [b]new[/b] operators is in c++ not C. What's the difference between C and C++. Hundreds of differences. You can't …

Member Avatar for Ancient Dragon
0
281
Member Avatar for technogeek_42

string.h is for C programs, not C++. The std::string class is declared in <string> header file [code] #include <string> using namespace std; [/code] >>what is the syntax for string [URL="http://www.cppreference.com/cppstring/index.html"]Here [/URL]is a complete list of string functions

Member Avatar for Ancient Dragon
0
95
Member Avatar for andyg55

delete lines 38 and 41 because tha loop only executes once, so there is no point to having a loop there. line 41: just make it a simple else statement. If the value is not < 0.4 then there is only one other choice, That whole loop can be simplified …

Member Avatar for VernonDozier
0
295
Member Avatar for GPXtC02

>>is it possible to pass two variables back from a float function.. one through 'return variable' & the other through reference Absolutely yes. If you can't get it to work right then post the code. Here is a common way to do it. [code] int foo( int& x) { x …

Member Avatar for GPXtC02
0
87
Member Avatar for prljavibluzer

what compiler and operating system ? >>Sorry for any bad english, it's translated text. Looks ok to me. :)

Member Avatar for prljavibluzer
0
124
Member Avatar for polaris
Member Avatar for Jx_Man
0
23
Member Avatar for CoolGamer48

What compiler are you using? VC++ 2005 or VC++ 2008 ? Those two compilers enable UNICODE by default. UNICODE is a standardized way to use non-English languages is programs and requires some changes to standard C or C++ character arrays. If you don't care about foreign languages then you should …

Member Avatar for CoolGamer48
0
121
Member Avatar for coolerli

line 42: [b]cstr[/b] pointer has not been assigned any memory, and scanf() is just scribbling all over memory. So what are you attempting to do in lines 41-43 anyway? Since the text at line 40 does not contain any spaces then line 42 sscanf() would be the same as strcpy(), …

Member Avatar for Ancient Dragon
0
126
Member Avatar for Blythe24

[quote] user: 01234567, initial number: 106 output: 107, 110, 111, 112, 113, 114, 115, 116, 117, 120, 121. [/quote] I don't get it. How do you go from 106 to 107 then 110 etc. ? what is the relevance of 01234567?

Member Avatar for jazzman05
0
106
Member Avatar for viper89

one way would be to use a stringstream object [code] #include <sstream> ... ... #define SZARRAY(x) (sizeof(x) / sizeof(x[0]) int array[] = {1,2,3,4,5}; string str; streamstring stream for(int i = 0; i < SZARRAY(array); i++) stream << arrray[i] << " "; str = stream.str() + "\n"; [/code]

Member Avatar for Ancient Dragon
0
105
Member Avatar for bhutta2005

What the hell is that poll for? Is just plain dumb. Ok so you posted your homework assignment. [URL="http://www.daniweb.com/forums/announcement8-2.html"]Where is your attempt to solve it [/URL]?

Member Avatar for Ancient Dragon
0
106
Member Avatar for esy928

you have to remove the key from the keyboard buffer [code] if( kbhit()) { getche(); y++; } [/code]

Member Avatar for esy928
0
237
Member Avatar for ShyamalShah

[URL="http://www.daniweb.com/forums/announcement8-2.html"]We only give homework help to those who show effort[/URL]

Member Avatar for neosomosis
0
111
Member Avatar for IIMarckus

[QUOTE=carnage;523468]i was about to ask this question too so what's the proper way? i always do declare globally this one [code=c++]using namespace std;[/code][/QUOTE] Didn't you even bother to read the rest of this thread ?

Member Avatar for IIMarckus
0
141
Member Avatar for Diabloizzle

Are you running Dev-C++ on MS-Windows? If yes, I had that error too and fixed it by changing the default include directory paths to full paths. I found that suggestion on the net somewhere and it worked for me. If that's your compiler then I'll give you more explicit/detailed information …

Member Avatar for Ancient Dragon
0
76
Member Avatar for werks

I vote for google too. Never used yahoo but I doubt it can beat google's search eigine for speed and number of links. Of course on the otherhand who realy need 100 million hits for a simple question ?

Member Avatar for joshSCH
0
231
Member Avatar for jimmy.rocks1

[QUOTE=jimmy.rocks1;523876]i m trying to terminate a thread when it is executing . could anyone help me how to go about this... thanks, aravind[/QUOTE] Depends on the operating system, how the thread was created and how you want to terminate it. If you used win32 api function [URL="http://msdn2.microsoft.com/en-us/library/ms682453.aspx"]CreateThread[/URL]() then look at …

Member Avatar for Ancient Dragon
0
132
Member Avatar for kxh29

I don't see why someone couldn't write a function named dialog() for *nix -- it obviously is not the same as a MS-Windows DialogBox. Do you have to source code for that function? If not then your only recourse is to read the documentation, and you say there is none. …

Member Avatar for Ancient Dragon
0
132
Member Avatar for Agni

>>the privilege of getting one query answered by a PM by one of the Mods Most of us work here volunteerly, meaning without pay. If you want to get answers via PM I'm sure there are paid sites where you could ask them. Shoot, deposit $200.00 USD in my pay …

Member Avatar for Ezzaral
0
112
Member Avatar for SteveDee

your while statement is incorrect [code] while( infile>>thisdate ) { // blabla } [/code]

Member Avatar for Narue
0
577
Member Avatar for driplet

google for that error number shows several threads about it. [URL="http://www.velocityreviews.com/forums/t287331-quotanyhquot-e2293-expected-at-line-210-why.html"]Here[/URL] is one of them that may be helpful to you. The most likely cause is a missing header file, or an error on a previous line(s)

Member Avatar for driplet
0
154
Member Avatar for la1

Welcome to DaniWeb la1 -- but please leave your crumbs, drops and goop at work before posting :)

Member Avatar for Jx_Man
0
87
Member Avatar for Allen 0108

when compiling from a command prompt you need to set the PATH environment variable to include the compiler's bin directory or whereever the compiler's executable files are. you can do like this: write a small batch file that contains this line [icode]SET PATH=%PATH%;C:\BORLAND\BCC55\BIN [/icode] Then every time you create a …

Member Avatar for Adrian99420
0
111
Member Avatar for kv79

no -- the rc file is compiled and attached to the *.exe. If you need to change one of the resources in it during runtime you will have to make in-memory changes.

Member Avatar for Belrog
0
102
Member Avatar for mark192
Member Avatar for briansmall

>>But we can only pay attention to, absorb so much. After that, it's just white noise. Are we hearing any more than we did before? Is the quality any better? I never ever read blogs (at least not that I know of), so I don't have that problem. It seems …

Member Avatar for vmanes
0
125
Member Avatar for teppuus

you can start by deleting line 516 because it is nothing more than a huge memory leak. When walking backwards you can't check for pCurrent == NULL because what you want to check for is while pCurrent != the head of the linked list, and the head is never NULL …

Member Avatar for teppuus
0
178
Member Avatar for unsure person

Welcome to DaniWeb Julian. >>i was wondering if this was a entry level course or do i have to do a course prior to this You will have to ask your college counsler about that because every school is different. Look up that course in your college course book and …

Member Avatar for jbennet
0
44
Member Avatar for EchoQuiet

Welcome to DaniWeb EchoQuiet -- wow! not many people write a novel as their introduction. But interesting reading. Hope to see you around alot, especialy in the Web Development boards.

Member Avatar for jbennet
0
234
Member Avatar for coolbreeze
Member Avatar for vmanes
0
161
Member Avatar for The Dude

Its times like that when I truely believe in the theory of [b]survival of the fittest[/b].

Member Avatar for twomers
0
112
Member Avatar for shadowfire36

An IDE is just a visual interface for a compiler. Visual Studio C++ is an IDE and a compiler. When you select Build in the menu the IDE invokes the compiler to compile the program. I suspect what you teacher wants you to use is a command-line only compiler such …

Member Avatar for WaltP
0
959
Member Avatar for jimmy.rocks1

First, the new thread must be either a static class method of a simple function. A DWORD is just an [b]unsigned long[/b], but don't count on that being the case in all versions of Windows. To pass multiple parameters, create a structure with all the variables you want to pass …

Member Avatar for jimmy.rocks1
0
122
Member Avatar for MikeKristal

how are [b]fix[/b] and [b]username[/b] declared? I would presume from the name of the variable that [b]username[/b] is a character array. Then why are you assining an integer to a character array? Doesn't make sense. If you want to debug that switch statement it is easier if you put those …

Member Avatar for MikeKristal
0
117
Member Avatar for francisprite

The ascii value of '0' is 48. So the values of row and col on lines 24 and 25 are 48 and 46 respectively. That means the switch on line 26 doesn't do anything because the value of 48 is not one of the case statements. Next, line 52 reads …

Member Avatar for WaltP
0
100
Member Avatar for Maelstrom80

line 34: the first parameter to strtok() is supposed to be NULL. It should be a valid string only the first time strtok() is called, which was on line 33.

Member Avatar for Ancient Dragon
0
129
Member Avatar for damir_john

how much C or C++ experience do you have? None? Then start at the beginning, buy or borrow an introduction book and start studying from page 1. In 6 months or so you will have enough knowledge to answer that question yourself

Member Avatar for JRM
0
149
Member Avatar for winrycool

depends on your compiler. The only compiler that supports graphis.h is old 16-bit Borland such as Turbo C. If you really want to learn c++ program then trash that compiler if that's what you are using and get a free modern one. Afterall, you can't learn to drive a car …

Member Avatar for Colin Mac
0
84
Member Avatar for bhuvanwip

you'll have to post the code surrounding that error. Could be a missing header file, or any of another 1,000 reasons.

Member Avatar for wamuti
0
281
Member Avatar for hallinan

>>One problem is the the programs stops at a certain point which is noted in the code Please identify the line number. Did you forget to mark it because I don't see it.

Member Avatar for hallinan
0
535
Member Avatar for Jboy05

after inputting the number start a loop that uses the mod operator % to get the last digit of the number and then divide the number by 10 until the result is 0. Or input the number as a character array then simply display each character on a separate line.

Member Avatar for JRM
0
1K
Member Avatar for gcardonav

After a little testing it appears that the c++ doesn't support fstream in that error class when used in a throw statement. Comment out the fstream object and it the program compiles ok. I'm not enough of an expert in this to tell you why that is happening.

Member Avatar for vijayan121
0
141
Member Avatar for ndeniche

I agree that would be a nice added feature. There are several menus that this would benefit.

Member Avatar for ~s.o.s~
1
90
Member Avatar for rwagnes

This is not a standard MFC class so you will have to read the docs from wherever you got it. Most likely from [URL="http://www.codeguru.com/cpp/data/mfc_database/microsoftexcel/article.php/c4307/"]here[/URL].

Member Avatar for rwagnes
0
573

The End.