15,300 Posted Topics
Re: You need a vacation if you are dreaming about google :) | |
Re: >>fatal error C1083: Cannot open include file: 'close_code.h': No such file or directory It means exactuly what it says it means. The compiler can't find close_code.h ? | |
Re: >>player1score = add10 (player1score); The first example doesn't work because it never changes the value of player1score variable. In the above code, when add10() returns it assigns the return value to player1score. That is not done in the first example. Passing a variable by reference does not do anything if … | |
Re: The program [b]depends.exe[/b] distributed with the compiler will tell you all the DLLs that are required by your program. Probably one or more of them are missing or the wrong version. | |
Re: You can not call malloc() to allocate c++ classes. It doesn't work. Use the c++ [b]new[/b] operator. You have to call either [b]delete[/b] or [b]delete[][/b] to destroy it. | |
Re: >>float main(void) main() does NOT return float -- only returns int [code] float abc(float *x) { float p; scanf ("%f",x); p=*x* *x; return(p); } int main() { float a,b; a = abc(&b); printf("a = %f\nb(x) = %f\n", a, b); } [/code] | |
Re: It's probably time for you to invest some $$$ and buy a good c++ book that covers a lot more than just the basics. Just because it will contain a chapter or two on data types, loops, etc doesn't mean you have to actually read them. Just skim over the … | |
Re: Memory allocated in a DLL must be released in the same DLL. Memory allocated in the main *.exe program must be released in the main application program. You cannot allocate memory in the DLL and release it (delete or delete[] or free() ) it in the main application program. So … | |
Re: If the files are small enough why not just copy to 5 1/4" floppy diskette? Then copy then onto the XP file system. You might also be able to create a LAN and copy them directly. | |
Re: [code] char answer; cout << "Enter Y or N\n"; cin >> answer; cin.ignore(); // ignore '\n' answer = tupper(answer); // convert to upper case if( answer == 'Y') { // blabla } [/code] | |
Re: what compiler are you using and on what operating system? Suggest you google for that error message and you might find the problem. | |
Re: >>strftime(date,3,"%W",&tim); Why? the tm structure already contains the weekday in numeric form. Just use it. | |
Re: Check the result of scanf(). Maybe the last line of the file is a blank line. | |
Re: [URL="http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/"]Read this [/URL]to research your question. There are a few links to games at the bottom of that link you might want to read. I have not read them so I don't know what they contain. | |
Re: Most likely your program is losing data because it does not have an interrupt driven input driver. If you used win32 api functions you would not have that problem. See [URL="http://msdn.microsoft.com/en-us/library/ms810467.aspx"]this article[/URL] | |
Re: Note that the terms "IN", "OUT", and "INOUT" are just a description of what the parameters are used for. Only for human consumption and mean absolutely nothing to the actual program or function. When you learned C or C++ language you did not use those terms, but you did learn … | |
Re: Don't understand the question. The code snippet you posted looks perfectly ok to me (other than the obvious that its not in a function and missing the last } character) Did you bother to compile and run the program to see what it produces? If not then you should do … | |
Re: You have stated your assignment (probably homework) but you didn't state your question(s). | |
Re: The way I understand the problem, the array does not have to have 10000 elements -- 10000 is just the maximum value that any one element may contain. In otherwords you have to generate an array that contains N elements (allocate with [b]new[/b] operator), the value of each element is … | |
Re: Could be one (or both) of two problems: 1) The destination can not be just the path, but the path + filename. The destination filename may be the same as the source filename or something else if you want to rename it. 2) You may not have permissions to write … | |
Re: cruise.h is something you made up, so you'll have to post it if you expect any help. | |
Re: No one here is going to write your program for you. You should have started on that at least a week ago if it's due tomorrow. So much for your procrastination. The assignment seems pretty clear to me. Do you know how to create a class? No, then study your … | |
Re: line 14: That declares an array of MAXSTRLEN number of pointers. Its not a character array. Remove the *. line 21: There is no need for the typecast. line 22: There is no need to increment both variables [b]i[/b] and [b]count[/b] because they both have the same value. line 24: … | |
Re: Here is how I did it in MFC (have not used managed CLR but it might be the same). In Form2 create a public variable that holds whatever you want to pass it, then in Form1, just after gcnew line, set the value of the variable. Once Form2 starts it … | |
Re: The size of data types is mostly compiler dependent. See limits.h for sizes and maximum values. >>Was short type ever was 1 byte and changed to 2 bytes later on? Not that I know of, but could have been depending on the compiler. >>How to specify long long int and … | |
Re: probably because you didn't include code to keep the window open [code] printf("Hello World\n"); getchar(); // wait for you to press the Enter key [/code] | |
Re: Hint: The return value to a is undefined because the function doesn't explicitly return a value. Also, most modern compilers will produce errors on that code. | |
Re: Not likely to keep the path or filename because it is only needed to pass along to the operating system so that it can open the file and return the handle to fstream. You could subclass fstream so that it saves that information. | |
Re: You forgot to include [sarcasm] and [/sarcasm] tags :) | |
Re: I would think it would be better to implement the queue as a linked list so that it can contain an (nearly) infinite number of items in the queue. | |
Re: >>*(float*) variable = 34; It is typcasting [b]variable[/b] into a float *, then assigning the value 34 to it. DWORD* is doing something similar to above. DWORD is defined by Microsoft's windows.h to be [b]unsigned long;[/b]. So its the same as (unsigned long *) I've studied MFC a lot and … | |
Re: No. But there is a win32 api function that is called. VS 2005 is nothing more than a compiler and IDE. I think something in [URL="http://msdn.microsoft.com/en-us/library/ms645533%28VS.85%29.aspx"]this link[/URL] will help you | |
Re: Look at those two lines and see if you can't figure out what is wrong with them. Read the error messages carefully because they tell you exactly what is wrong. | |
Re: [code] struct item { string name; float price; }; int main() { item it[] = { {"Fried Chicken",12.99F}, {"Pork Chops", 10.99F}, {"Soda", 2.99F} }; for(int i = 0; i < sizeof(it)/sizeof(it[0]); i++) { cout << setw(20) << left << it[i].name << setw(5) << right << it[i].price << '\n'; } } … | |
Re: Under MS-Windows the only way is to call CreateProcess() to launch the console program. One of that function's parameters will tell it to create the process without a console. | |
Re: >>hv no time to read dat help topics.. Then go watch TV of play some video games. The same site you download the compiler has a tutorial. Go read it and stop being so childish. | |
Re: >>please check this script Why? Check it yourself by compiling and running it. We are not your compiler. | |
Re: You want to use win32 api [URL="http://forums.devshed.com/c-programming-42/c-help-with-enumwindows-getwindowtext-needed-please-332249.html"]EnumWindows[/URL] | |
![]() | Re: you don't have to convert anything -- just write the array to a file as it is. BTY: you can not write bits to a file -- only bytes. ![]() |
Re: Your error check is not going to work. Why? Because if someone enters more than 16 characters then the entire program will get trashed and there is nothing that you can do to avoid it. That's one of the problems with scanf(). What I would do is get the string … | |
Re: you can use '\r\ to move the cursor back to the beginning of the current line so that you can print some other text, e.g. [icode]printf("\rHello");[/icode] | |
| |
Re: >>void writeIteratively (ostream& outfile) That function does not have a [b]this[/b] pointer because its not a member of a c++ class. Maybe you meant [icode]void BinarySearchTree::writeIteratively(...);[/icode] | |
Re: When the elements of the array are moved (or copied) up a slot that will overwrite whatever was there before. That does not make the arrray smaller, it just means the last array element is left empty, or unused. | |
Re: You are asking about how to flush and discard the input stream of all its contents. Narue wrote [URL="http://www.daniweb.com/forums/thread90228.html"]this thread [/URL]some time ago that explains how to do that. | |
Re: >> string tscore[26]={}; You don't need to create an array of std::string objects. Just one will do, such as [icode]std::string tscore;[/icode] This code will give you one string with embedded '*' s. Note that you will have to add code that prevents the last '*' from being in the string. … | |
Re: Look at line 30 of the code snippet you posted. See -- it has one parameter. Now look at line 23 ... there is no parameter. That's what the compiler is complaining about. You need to pass by reference the object you want to subtract. You need to create another … | |
Re: There is no standard C or C++ way to do that. There are a couple non-standards methods, depending on the operating system. For MS-Windows compilers you might look to see if your compiler supports conio.h. It has functions such as kbhit() that checks to see if something is available at … | |
Re: [code] char value1[10]="new york"; char value2[9]="st louis"; char result; v1=&value1[0]; v2=&value2[0]; [/code] All those lines are in the wrong function. Mystrcmp() needs to compare the two strings that are the parameters to the function. [code] int main() { char value1[]="new york"; char value2[]="st louis"; int x = Mystrcmp( value1, value2 … |
The End.