15,300 Posted Topics

Member Avatar for rje7

Neither flush() nor fflush() are used on input streams. [URL="http://www.daniweb.com/forums/thread90228.html"]Read this [/URL]for how to flush input streams. >>both do the same functions Yes -- flush() is used by c++ streams in <fstream> and fflush() is used by C streams declared in <stdio.h>. Both flush the output stream.

Member Avatar for rje7
0
111
Member Avatar for nelsonsu

lines 20 and 23 are wrong. Remove the word [b]typedef[/b] from each of those two lines. lines 31, 32, 64 and several others are just a huge mess. Put each of those statements that end with semicolons on different lines so that your program is easier to read. It not …

Member Avatar for nelsonsu
0
155
Member Avatar for Ancient Dragon

I don't know what happened but about an hour or so ago the submenus stopped working unless I click on the main menu. For example, I can't get the dropdown menu unless I first click the Software Development menu. After than, the submenus all appear normally until I post a …

Member Avatar for Ancient Dragon
0
65
Member Avatar for cjw3131

you are getting those errors like on line 23 because you put data types as parameters and it expects variable names. For example: [icode]if( getPattern(&term1, &term2, &term4, &term5) ) == 1)[/icode]

Member Avatar for Ancient Dragon
0
92
Member Avatar for RossSCann

VC++ 2008 Express is free for the downloading from M$. It doesn't support MFC, otherwise its nearly identical to the other paid versions. You can also download free Visual Studio C# and VB compilers.

Member Avatar for RossSCann
0
178
Member Avatar for gehad3003

Padding integers with 0 to the left is a display thing only -- internally integers do not have leasing zeros. How to make them depends on how you are displaying them, such as are you using printf() or cout ? [code] int number = 12; printf("%04d", number); cout << setfill('0') …

Member Avatar for gehad3003
0
165
Member Avatar for SamiMarufi

>>n wht abt making files ( to save data when using program ) .. Yup -- your program will need to do that too. You have to design what the file contents look like then write them according to your design.

Member Avatar for skatamatic
0
129
Member Avatar for Google Spider

[QUOTE=cscgal;563295]<offtopic> I've been wonderng this for awhile now. What does 'Dazza' mean? </offtopic>[/QUOTE] [URL="http://portal.purehotmodels.com/portal/index.php?option=com_gallery2&Itemid=15&g2_itemId=139"]Dazza[/URL]

Member Avatar for sneekula
0
218
Member Avatar for William Hemsworth

>>txt += INTTOCHARP(ballcount[0]); In COUNTBALLS() -- INTTOCHARP() allocates memory with new but is never deleted.

Member Avatar for William Hemsworth
0
200
Member Avatar for DanLB

>>First off all; I apologize for my poor english skills, i'm from sweeden' You are doing great so don't worry about it. There are a couple ways to mondify the data in the vector [code] int main() { vector<Book> Person; Book x; cout << "Enter name: "; getline(cin,x.Name); cout << …

Member Avatar for Ancient Dragon
1
530
Member Avatar for Ancient Dragon
Member Avatar for The Dude
0
33
Member Avatar for henpecked1

[icode]void statistics (int rolls[];int rollsize; int rollresults [])[/icode] You're supposed to use commas to separate the parameters, not semicolons. And if that line is the start of a function where are the { and } at the beginning and end of the function?

Member Avatar for vmanes
0
310
Member Avatar for amitahlawat20

[URL="http://www.codersource.net/cpp_virtual_destructors.html"]Here [/URL]is one explaination, but the examples are not good. Below is corrected example. Test it out on your own computer by comparing the outputs with and without the virtual keywords. [code] #include <iostream> using namespace std; class Base { public: Base(){ cout<<"Constructor: Base"<<endl;} virtual ~Base(){ cout<<"Destructor : Base"<<endl;} }; …

Member Avatar for Ancient Dragon
0
79
Member Avatar for bhoot_jb

In each of your examples pointer p was never initialized to point to any memory so what you get is a crashed program. And Yes, in each of the cases you statef for Q 1 a new variable name is created and occupies stack space. If all you want to …

Member Avatar for WaltP
0
105
Member Avatar for jerryseinfeld

[quote=jerryseinfeld;359827]I research on the site and I found hexa code form ancient dragon[/quote] Please don't blame that code on me!:) I didn't write it. >>[COLOR=#000000]Second question is how can I write hexadecimal numbers? can c recognize hexe??[/COLOR] I assume you mean a string that contains hex, such as "0x0a".

Member Avatar for yupi
0
430
Member Avatar for lasher511

Naw -- Janeway was only ok. I liked the overall story line, but tv station in my area pushed the timeslot back so far that it was too late for me to watch it. So I didn't get to see the last couple seasons. My favorite critter (or race) was …

Member Avatar for Ancient Dragon
0
155
Member Avatar for bhoot_jb

The first one only looks more efficient, but IMO the second one is because you can reference matrix just as you would any normal 2d array [icode]matrix[i][j] = 0;[/icode]

Member Avatar for bhoot_jb
0
116
Member Avatar for metropolisiii

give the text file a *.cpp extension then call your compiler to comple it. g++ might be a good one to use for this because of the extensive make file you can create which will tell the compiler how to compile it.

Member Avatar for Ancient Dragon
0
69
Member Avatar for dolphin.rise

[URL="http://www.javaworld.com/javaworld/jw-11-1998/jw-11-techniques.html"]This article [/URL]was written for Java but applies to C++ too.

Member Avatar for Ancient Dragon
0
128
Member Avatar for knewc

why don't you put the call to fib() in a loop and pass the loop counter in the parameter

Member Avatar for BlackJavaBean
0
107
Member Avatar for DimaYasny

[QUOTE=DimaYasny;562191]Guys, isn't it time we started a new 2008-specific section? [/QUOTE] Why? there is no such operating system.

Member Avatar for jbennet
0
87
Member Avatar for pieterh

Welcome to DaniWeb. We'll let you say howdy to everyone else around the globe too :)

Member Avatar for Mashka
0
54
Member Avatar for dolphin.rise
Member Avatar for TheFueley

you can't write std::string objects to a binary file like that. The easiest way to simplify your program is to use a char array instead of std::string. Now in the class constructure initialize that char array to all 0s. [code] class Rivera { public: Rivera(); void setKey(const int); int getKey() …

Member Avatar for TheFueley
0
122
Member Avatar for Jboy05

line 15 is still wrong -- what is it that you want to do when the value of num is odd ? I know you don't want to open the output file because you already did that at line 9. Someone else already gave you a hint of what to …

Member Avatar for Ancient Dragon
0
100
Member Avatar for complexcodes

OMG I take it you haven't even attempted to compile that code because it is just littered with errors. Fix the errors then come back to us, post new code and questions. I started to make some corrections but gave up not because I didn't know how to correct them …

Member Avatar for complexcodes
0
111
Member Avatar for cpp_noobsauce

[code] while ( invoiceInitilization != 'y' || invoiceInitilization != 'Y' || invoiceInitilization != 'n' || invoiceInitilization != 'N' ) [/code] Those should be && operators, not ||. You can simplify that by converting to either upper or lower case so that you don't have to test for all 4 [code] …

Member Avatar for cpp_noobsauce
0
135
Member Avatar for big24fan

Were is the program you wrote? Or did you answer the questions at all ? If you couldn't answer the test then you need to restudy your text book from page 1 and do all the extercies at tne end of each chapter. If you don't do this then you …

Member Avatar for buddy1
0
164
Member Avatar for gothicmisery85

baccount..h lines 20, 21 and 22. You need to specify the return type, such as int. Why are you using ints for balance, deposits and withdrawals -- only whole values acceptable with no cents ? There are many many more errors due to not including the function return types and …

Member Avatar for gothicmisery85
0
139
Member Avatar for knewc

use either global or static local variable then just increment it at the beginning of the function.

Member Avatar for Ancient Dragon
0
82
Member Avatar for mar000m

Did you try [URL="http://www.google.com/search?hl=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=radix+sort&spell=1"]google[/URL] ? >>if any one can help by friday 21-march many people will just ignore you if you add a date-due to your pose. Your suspense date if your problem, not ours.

Member Avatar for Ancient Dragon
0
52
Member Avatar for SJin

try this: [code] string reverse(string line) { int len = line.length()-1; string clean; while( len >= 0) { clean += line[len--]; } return clean; } [/code]

Member Avatar for Ancient Dragon
0
93
Member Avatar for 666kennedy

[icode]ERRORC = (( target1 ) - ( OUTC ) )(OUTC)(1 - OUTC);[/icode] That statement contains mismatched parentheses. Count them and you will see that there are too many of them. You can't do multiplication with the (xxx)(yyy) syntax, meaning xxx times yyyy. You have to use the * operator if …

Member Avatar for Ancient Dragon
0
138
Member Avatar for awoc

>>I don't understand where exactly to put constants normally go right after the includes and before any function.

Member Avatar for awoc
0
118
Member Avatar for Traicey

All you have to do is replact <= 10 to < 10 in each of the two loops [icode] for(int x = 1; x < 10; x++)[/icode]

Member Avatar for Narue
0
2K
Member Avatar for Jboy05

line 10: Since Afile is an input file you can't use the << operator. So you probably meant to use cout instead of Afile to print the text on the screen. lines 12 to 15: There is no difference between those conditional statements so you might as well not have …

Member Avatar for Jboy05
0
143
Member Avatar for indianscorpion2

>>now how do i urge the users to click on the ADS plese give me a word of advice..... A sure-fire way to lose all 800 members is to tell them they have to click on the adds. If you did that to me when I joined your site you …

Member Avatar for 2bu
0
1K
Member Avatar for 666kennedy

your code needs to call pow() to raise x to the power of y. Don't know what [b]exp[/b] is in your code.

Member Avatar for 666kennedy
0
307
Member Avatar for barasa

Welcome to DaniWeb >>i was told that by doing IT i need another booster studies in programing language's. is it a must? Only your university or college can answer that. Ask your college counsler.

Member Avatar for bobbyraw
0
62
Member Avatar for krichard89

>>it goes back and asks for another letter input without an infinite loop? Put lines 47 to 74 in an endless loop or a conditional loop when ends when some condition is met.

Member Avatar for Ancient Dragon
0
81
Member Avatar for Traicey

>> "U better get it all wrong than copying it or writting something that u dont understand coz U gona get 0 if u cant explain what u did or u have copied it" Good for your instructor :) :) I'm not about to rewrite your program for you because …

Member Avatar for Traicey
0
103
Member Avatar for bhoot_jb

Its not necessary to pass those pointers by reference because the functions aren't changing them. Passing by reference in those functions does nothing more than bloat the code. Just pass the pointers instead. >>++mat->element; You don't want to do that. Do it like this: [code] for (int j = 0; …

Member Avatar for bhoot_jb
0
168
Member Avatar for nabilchampion

On *nix all you have to do is pass the right arguments in the open statement and it will work the same way as CreateFile() odes. check your compiler to see if it has [URL="http://msdn2.microsoft.com/en-us/library/8f30b0db(VS.71).aspx"]fsopen()[/URL] because I'm not sure if that function is standard C or not.

Member Avatar for Ancient Dragon
0
119
Member Avatar for AntiBNI

You could display the message in another thread. Before calling the dialog's DoModal() create a thread and have it display the message for however long you want it visible. Call win32 api function CreateThread() to do that. The function isn't very difficult to use because some of the parameters can …

Member Avatar for Ancient Dragon
0
66
Member Avatar for gehad3003

[URL="http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8637&lngWId=3"]Here is one way to do it[/URL].

Member Avatar for gehad3003
0
98
Member Avatar for kartouss

[QUOTE=kartouss;546938]Is there another way to solve this problem instead of using files...[/QUOTE] Of course -- just store the encrypted data in memory. But of course when your program ends to does that data :)

Member Avatar for kartouss
0
549
Member Avatar for davye_l

From the error description I think the Elec class contains one or more pure virtual functions. If that is true then you can only allocate derived classes. >>Can somebody have an idea to how to solve this issue?? allocate componment[i] to be one of the derived classes.

Member Avatar for davye_l
0
60
Member Avatar for k2k

The function beginning at line 52 inserts a new node at the head of the linked list. It does this by first setting the new nodes's link pointer to the current head, then changing the current head to be the new node. The function looks like it will work correctly. …

Member Avatar for Ancient Dragon
0
108
Member Avatar for Jennifer84

If that text box is like MFC then you have to get the string that's already in the box, make whatever changes you want, then put the entire string back.

Member Avatar for Jennifer84
0
154
Member Avatar for lAmoebal
Member Avatar for Ancient Dragon
-1
236

The End.