15,300 Posted Topics
Re: >>(I will also post this thread at c++ area, hope you don´t mind ) Yes we do so don't do that. Pick a forum and stick with it. | |
Re: memory for that array is not layed out by pointers. The first 20 bytes are for the first string, that is followed by the next 20 bytes for the second string, etc. So fetchoutStr() needs to treat it as if it were just a single-dimension character array that can hold … | |
I'm in the market for a blu-ray drive on my HP computer. I've googled and found a few, rather expensive ones. All I want to do is play blu-ray movies with it -- don't way to bun them or use it to copy them. Anyone have any knowledge about them … | |
Re: delete lines 80 and 81 because those two variables are not needed. Now all you have to add is a simple loop tocompare the letters of each string. If they are not then same then increment NumMissed counter. | |
Re: >>while (status=2) Use the boolean == operator there, not the assignment = operator. >>The pointer says the error is in the line previous to main. The line previous to main() is a blank line. Repost your current code so that we can see what you are talking about. | |
Re: In think this is what you want. Allocating pointer p is not necessary. To make a PXQ array you have to allocate Q integers for each row in P. [code] void destroyArray(int **a, int P) { int i; for(i = 0; i < P; i++) free(a[i]); free(a); } int **allocarray(int … | |
Re: line 49 is missing { opening brace on that function. | |
Re: >>if (option == "enter") { You can not compare strings like that in C programs. use [icode]if( stramp(option, "enter") == 0) { [/icode] >> tell me what header I have to use for 'fgets'? stdio.h | |
Re: Happy Holidays everyone :) Wish I could be there to help celebrate. Instead, I'll just drink a beer for you. | |
Re: Sounds like the M$ DLL is not located in one of the directories in your PATH environment variable. Most likely it should be in c:\windows directory or one of its sub-directories (system32?). | |
Re: Its not necessary to actually change the current working directory. [URL="http://www.daniweb.com/code/snippet216812.html"]See this code snippet[/URL] for example how to do that. | |
Re: Go to the store and buy it then. We won't help you get pirated copies of software. | |
Re: The functions you are seeking is [URL="http://msdn.microsoft.com/en-us/library/ms997537.aspx"]Windows Hooks[/URL]. Just include <windows.h> and you will get their prototypes, as well as declaration of BOOL and other win32 macros/defines. | |
Re: [QUOTE=sweetyyy;1126172]i want the answer for a program wap to accept data dere we have to count number of characters,words,lines i am waiting for reply[/QUOTE] We don't do homework. You do the work, You post the code, You ask questions about what You do not understand. We will help with that … | |
Re: Q1: The program does not do any integer math -- its all floats, and may floats can not be represented exactly. What makes you think there are any errors in the computations? Here are the results I got [quote] Please enter the value of x1: 1 Please enter the value … | |
Re: allocate it [code] class MyClass { // blabla }; int main() { MyClass* pClass = new MyClass; } [/code] | |
Re: The asserts on lines 30 and 38 will not work because the value of [b]t[/b] is the julian date so it will equal the specified value in the assert statement only on the very first iteration of the loop. you could do something like this on line 17 of the … | |
Re: >>which statement is executed after returning from the recursive call. Line 45, then the loop continues, but at that point the value of [b]i[/b] is the value of [b]length[/b] - because lines 39 and 40 advance [b]i[/b] to the end of the output string before doing any recursion. | |
Re: >> From were Money Comes??? Many people think it comes off a money tree. And the plastic cards everyone in USA seems to have today have made paper money less useful. I assume many other countries such as UK also has simpliar experience with plastic. | |
Re: why do you need to ask us -- just run the program and find out for yourself what the output is. | |
Re: line 12: that will only read one character, not the entire string. Call fgets() if you want to read the entire line, including spaces [icode]fgets(a, sizeof(a, stdin) );[/icode] line 13: Q: what is the value of variable [b]i[/b]? A: Undefined because it was never initialized to anything. line 19: %s … | |
Re: >>class MergingLists : public list AFAIK a template can not be used as a base class to non-template c++ class. | |
Re: After closing the file on line 20 you need to clear fstream's error before opening it again. On line 21 add [icode]address.clear();[/icode] If that does not fix the problem then more than likely the file is not where you think it is. If it's not in the current working directory … | |
Re: I get the same behavior. I have a Windows 7 64-bit computer with 5 Gig RAM. I also just tried the resize() method and that doesn't work either. Possibly the program can not find enough consecutive memory for that size. Code::Blocks doesn't like that either -- it throws an error. | |
Re: I though you said the company already gave you the DLL??? [quote]the company has provided me with a header file and lib file and ofcourse the dll file[/quote] So why are you trying to recompile it? Just use the DLL that they gave you. Write your program, include their header … | |
Re: The "problem" is more than likely too many button controls :icon_eek: Maybe you need to redesign the project so that it doesn't contain so many controls. | |
Re: My password contains the name of an artifact from one of my favorite TV shows plus some numbers. And I use the same password everwhere, including DaniWeb. I've been told that an ideal password that would be very difficult to crack would contain at least 8 characters, at least one … | |
Re: First of all you don't want to use getline() to read a single word because getline() will read the entire line. It is better to use >> operator to read words like this: [code] std::string word; std::string filename; ... ... // open the ifstream (Note: ifstream should NOT be declared … | |
Re: why are you even using memcpy() -- what you want is strcpy(), not memcpy(). memcpy() is normally used to copy blopbs of binary data not standard null-terminated strings. | |
Re: call clock() before the loop starts and again after the loop ends, then subtract the two times. When the program runs fast enough the difference might be 0. In that case, put the loops into a function and call that function 1,000 times. [code] clock_t t1, t2; t1 = clock(); … | |
Re: When LoadLibrary() fails, call GetLastError() to get the error number, then FormatMessage() to format the error message string. [code] DWORD dwError = GetLastError(); char buf[255]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, dwError,0, buf, sizeof(buf)); cout << buf << '\n'; [/code] | |
Re: The best way to approach that problem is to use <vector>, not C-style arrays. vectors are arrays which will expand as needed to contain however may data objects you want to put into it. Just include <vector> and use [icode]std::vector<int> firstArray;[/icode]. When you want to add an integer just call … | |
Re: There are several ways to do it. One way is to parse the string one character at a time. Something like this (Note: This was not compiled or tested, so use it at your own risk). This does not solve your entire problem -- it just gets the numeric data. … | |
Re: Why do you have to convert those C functions at all? Just call them norally in any c++ code you want to add to the project and leave the C code in tact. In the c++ files you just have to add this: probably add it in the header file … | |
Re: >>The only file that is mine out of those errors is time.h name your heder file something else because your header file named time.h is most likely conflicting with the standard heder file time.h. namespaces do not resolve conflicts of file names. | |
Re: >>2- c:\>path = C:\pdcurs32\win32 DON'T DO THAT! because it will destroy the entire PATH environment variable. Instead, you need to run the vcvars32.bat batch file in the compiler's bin directory to set the compiler's DOS environment variables. I copy vcvars32.bat file into the c:\ root directory to make it easier … | |
Re: Scrap that old IDE/compiler and get either free Code::Blocks/MinGW or VC++ 2008 Express. But if it's at school then you may not have a choice. | |
Re: Store the data in a hidden file or if *nix a read-only file. You could also use an encrypted file. There is nothing that will be 100% tamper-proof. | |
Re: name your class something else because [b]string[/b] is already a class in <string> header file. line 10: That sure is a waste of time to call strcpy() with an empty string. All you have to do is this: [icode]s[0] = '\0';[/icode] line 25: delete the [b]string::[/b] part because its not … | |
Re: google for them? [b]UNICODE[/b] means the program is being compiled for UNICODE strings, such as using wchar_t instead of char. _x86_ means the processor is one of the 80x88 family of processors (Intel or compatible). _linux should be fairly obvious (os name). As for the other flags, they will depend … | |
Re: what is that [b]write[/b] function that you posted? It's not standard C or C++. | |
Re: [QUOTE=chandangang;761787]please explain your code[/QUOTE] getch() returns 0 when one of the special keys is pressed, such as one of the Function or arrow keys. When that happens the program has to call getch() again which will return the key code of the key that was pressed. The reason for this … | |
Re: In a loop only display a certain section of the string at one time. Like this, where str is std::string with the contents you want to display [code] for(size_t i = 0; i < str.length()-9; i++) { cout << '\r' << setw(10) << str.substr(i, 9); Sleep(100); } [/code] | |
Re: If you want to program Windows Forms why in the world would you want to use DirectX??? | |
Re: There are two main problems: 1) >> friend ostream &operator<<(ostream &os, const Puzzle& p); The last parameter should be passed by reference, not by value. Also change that in the *.cpp implementation file. 2) in Puzzle.h you need to declare the namespaces, such as [code] #include <fstream> using std::fstream; using … | |
Re: Welcome to DaniWeb. [QUOTE=owenb;1121269]I'm constantly getting into trouble by chosing options that I have no idea of what they do or what they are for.[/quote] That happens to me too :) [QUOTE=owenb;1121269] Presently I'm making a mess trying to concoct a network using Win2K and WinXP . Soon I may … | |
Re: See [URL="http://www.winprog.org/tutorial/menus.html"]this tutorial[/URL]. I suspect your problem is in the *.rc file. | |
Re: Weeeeeeelllllllccccccoooooommmmmeeeee! Hope you enjoy your stay here. | |
Re: >>Any ideas what is it that I'm missing? Yes -- if you are using MS-Windows or *nix operating systems than that will not work because your program can not change the memory values of memory it does not own. You can't just plug some random memory location into your program. |
The End.