15,300 Posted Topics
Re: 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. | |
Re: 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 … | |
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 … | |
Re: 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] | |
Re: 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. | |
Re: 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') … | |
Re: >>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. | |
Re: [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] | |
Re: >>txt += INTTOCHARP(ballcount[0]); In COUNTBALLS() -- INTTOCHARP() allocates memory with new but is never deleted. | |
Re: >>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 << … | |
Re: [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? | |
Re: [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;} }; … | |
Re: 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 … | |
Re: [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". | |
Re: 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 … | |
Re: 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] | |
Re: 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. | |
Re: [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. | |
Re: why don't you put the call to fib() in a loop and pass the loop counter in the parameter | |
Re: [QUOTE=DimaYasny;562191]Guys, isn't it time we started a new 2008-specific section? [/QUOTE] Why? there is no such operating system. | |
Re: Welcome to DaniWeb. We'll let you say howdy to everyone else around the globe too :) | |
Re: [URL="http://www.gidnetwork.com/b-66.html"]Read this[/URL] | |
Re: 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() … | |
Re: 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 … | |
Re: 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 … | |
Re: [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] … | |
Re: 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 … | |
Re: 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 … | |
Re: use either global or static local variable then just increment it at the beginning of the function. | |
Re: 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. | |
Re: try this: [code] string reverse(string line) { int len = line.length()-1; string clean; while( len >= 0) { clean += line[len--]; } return clean; } [/code] | |
Re: [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 … | |
Re: >>I don't understand where exactly to put constants normally go right after the includes and before any function. | |
Re: 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] | |
Re: 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 … | |
Re: >>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 … | |
Re: 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. | |
Re: 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. | |
Re: >>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. | |
Re: >> "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 … | |
Re: 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; … | |
Re: 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. | |
Re: 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 … | |
Re: [URL="http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8637&lngWId=3"]Here is one way to do it[/URL]. | |
Re: [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 :) | |
Re: 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. | |
Re: 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. … | |
Re: 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. | |
Re: We've already had one thread with this exact problem today. Read the responses in that thread. |
The End.