15,300 Posted Topics
Re: line 56 is wrong because the linked list is initialied to NULL every time that function is entered. What you have to do is pass variable [b]start[/b] from main() as a parameter into make_list(), like this (Note the double asterisk, or double pointer). [code] struct queue_node *make_list(struct queue_node** start) { … | |
Re: I think what you want is this: assumes number elements in array1 is the same as in array2 [code] int k = 0; int n = NumberElementsInArray1; for(int i = 0; i < n; i++, k++) { if( array1[d].ave > array2[e].ave ) { array3[k] = array1[d]; d++; } else if( … | |
Re: line 7 is not calling a function. You have to put () after the function name, such as day_menu(). You will also want to put something just before the return in main() (such as getchar()) to make the program stop so that you can see what is on the screen. … | |
Re: If you look at [URL="http://spike.scu.edu.au/~barry/interrupts.html#ah0a"]this link[/URL] you will see that the first two bytes of the input buffer contain the buffer size followed by the number of characters in the buffer when the interrupt returns. You have to declare the buffer to be at least three bytes larger than the … | |
![]() | Re: use [URL="http://msdn.microsoft.com/en-us/library/aa363194(v=vs.85).aspx"]Windows communications functions[/URL]. You can't access the ports directly as you did in MS-DOS. Instead, you have to open the com port using CreateFile(), then set up the port parameters with SetCommConfig(). After that you use ReadFile() and WriteFile() to read and write to the com port. For ReadFile() … |
Re: mkdir() will create a directory. google for mkdir() to get more information. | |
Re: why? No one in his/her right mind would want to manually convert that to assembly. | |
Glad to see you are working on the spacing problem with icode tags. Now we don't have to add those extra blank lines after the [noparse][/icode][/noparse] tag. Good work :) | |
Re: The problem with it under Web Development that everyone assumes that's the only purpose for databases. It isn't. Maybe it would be more logical and useful for it to be under Software Development. | |
Re: No change necessary, other than possibly changing the data source in the connection string. | |
Re: Read the file a word at a time instead of a character at a time. [icode] std::string word while( FileIn >> word ) { // blabla } [/icode] Then if the word is 3-6 characters add it to a list with a counter for the number of times that word … | |
Re: There is no "general" way to do it because it is operating system specific. C and C++ do not themselves have direct support for keyboards and mice. You could use ncurses which has been ported to both MS-DOS and *nix (there is not MS-Windows gui version of it). | |
Re: All the if statements starting on line 79 are wrong. Why? Because PHLEVEL is an integer, therefore by definition it does not have decimals. PHLEVEL is not a real number (float or double). Those lines are also badly formed -- they need to be like this: [icode]if( PHLEVEL >= 0 … | |
Re: yes it can be done, and yes it is more complex then doing it from basic or java. There are several free c++ classes that make database accessing easier -- see [URL="http://www.google.com/search?hl=en&q=c%2B%2B+odbc+classes"]these google links[/URL] There are other ways to do it too, but ODBC is the most versatile because your … | |
Re: call strcat() from string.h header file. But be careful -- the desgination character array has to be large enough to hold both strings, and it can not be a pointer into read-only memory (e.g. string literals). [icode] char boy[] = "Harry"; char* boy = "Harry"; // <<<< this is also … | |
Re: >>When I run the program and enter the value for cSalary the program just closes You have to put something at the end of main() to prevent that from happening. One way to do that is to add a line [icode]cin.get() before main() returns.[/icode] Programs execute the lines from top … | |
See the red arrow on the screenshot. This only happens in DaniWeb threads, nowhere else. The browser IE8 seems to always be waiting for something. | |
Re: try disabling any anti-virus software you may have running. | |
Re: It isn't necessary to typecast total because total was declared as an int I would line up all the else's and reverse the order of the tests [code] if( total < 60) printf("You are failing with a %d percent \n\n", (int) total); else if( total < 70) printf("%c---------||-----%d Percent\n\n", gradeLetters[3], … | |
Re: For MS-Windows operating systems you want to write a [URL="http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS397&q=c%2B%2B+windows+service+tutorial&aq=1&aqi=g6g-m4&aql=&oq=c%2B%2B+windows+service"]Windows Service program[/URL] The first few google links will tell you how to do that. | |
Re: You can write your own large number library using character arrays to hold each digit. [URL="https://mattmccutchen.net/bigint/"]Here[/URL] is one such library (c++ class) | |
Re: [URL="http://msdn.microsoft.com/en-us/library/ms687022(v=vs.85).aspx"]WaitForInputIdl[/URL]e() | |
Re: win32 api function [URL="http://msdn.microsoft.com/en-us/library/ms682425(v=vs.85).aspx"]CreateProcess[/URL]() will let you do it, and I think it will even let you specify the screen size in the [URL="http://msdn.microsoft.com/en-us/library/ms686331(v=vs.85).aspx"]startupInfo[/URL] parameter. | |
Re: The first parameter is not char** but char*. Delete key1 and key2 because neither are needed. And the last parameter is a pointer to your comparison function, which will be something like the following. Is variable catFreeEntry the number of elements in the catalog array of structures? [icode] int compare(void* … | |
Re: See [URL="http://www.cplusplus.com/forum/general/8510/"]this thread[/URL] | |
Re: I prefer them too, but they are not compatible with other languages or most win32 api functions. If you are not concerned with either of those then by all means use std::string. | |
Re: why are you doing that one character at a time? You can write the entire buffer all in one function call using fwrite(). You will want to open the file in binary instead of text mode. [icode]bytewritten = fwrite(buf,1,payload,fp);[/icode] | |
Re: can not have function name the same as a variable name. Change one of the two. | |
Re: Lots of programs that do it -- [URL="http://www.mysql.com/products/workbench/"]MySQL Workbench[/URL]. For a simple version such as what you want you will need to know SQL so that you can retrieve the information (table names, and information about each of the columns in the table). Then you will have to know how … | |
Re: You are experiencing a very common problem for new coder. When you enter Y for answer then you also press the Enter key, which is '\n'. That key stays in the keyboard buffer because your program only extracted the first character that was typed. You have to flush all the … | |
Re: The if statement on line 5 is wrong. You should be calling one of ifstream's metods. Sould be like this: [icode]if( install.is_open())[/icode] | |
Re: As with many other things there are no right or wrong answers to the questions you have asked. One programmer may do it one way while another programmer will do it some other way. Its all a matter of personal preferences, or in some cases, company coding policy. 1. Generally, … | |
Re: You can simplity all those if statements if you convert menuinput to either upper or lower case. And then you can use a switch statement. You can also delete all those variables on line 11 and initializations on lines 16-33. [code] menuinput = toupper(menuinput); switch(menuinput) { case 'A': // blabla … | |
Re: You have to declare functios before they can be used. Add a function prototype for menu() befor main(). | |
Re: There is no correct solution to the problem because: 1. The variable x is undefined and we don't know its initial value. 2. The value of x never changes, therefore that is an infinite loop 3. There is no if, so the else is incorrect. | |
Re: Post what you have done because nobody here is going to write it for you. | |
Re: I think you have mis-understood the assignment. Read it again, it doesn't want you to create a class named incrementMinutes but that is jusst the name of one of the class's methods. The name of the class is probably Time. I think you should post the exact wording of the … | |
Re: 1. No 2. Yes, providing you reallocate the memory before attempting to use it. . | |
| |
Re: In order to deleted text from a file you have to rewrite the entire file but omitting the text to be deleted. you can't just delete text in the original file. | |
Re: is the program gui or console? What operating system? What compiler? We need a lot more information before anyone can give you any help. | |
Re: >>printf("%s", bin);//pass bin must be a null-terminated character array if you want to use printf() to display its contents. For example. Note that you don't have to specifiy its size, the compiler will figure that out for you from the list of initializers. [icode]char bin[] = {'0', '0', '0', '0', … | |
Re: >>allows structs, but not objects. string is an object, or more technically called c++ class. | |
Re: If you ever used a Microsoft compiler you would know that they always produce stdafx.h, which is a catch-all for other includes. The most useful use of it is to compile c++ programs with pre-compiled headers. But this is a C forum and not C++ so precompiled headers is not … | |
Re: The first word in each line appears to be the account number. Everything from the end of the first word up to the first numeric digit can be assumed to be a name. After the name, everything up to either +, -, or a digit is the address. There's a … | |
Re: Huh?? What is "qcheck=all"? Is that a compiler option in Aix Unix os, such as [URL="http://publib.boulder.ibm.com/infocenter/cellcomp/v101v121/index.jsp?topic=/com.ibm.xlcpp101.cell.doc/compiler_ref/opt_check.html"]this one[/URL]? | |
Re: Wow!! Greate find :) Yes, size does matter, doesn't it. | |
[URL="http://www.youtube.com/watch?v=T67DvoH2H3E&feature=player_embedded"]Do you know what you are eating?[/URL] |
The End.