15,300 Posted Topics
Re: its probabably that while statement. when point == nextpost, when does nexpoint == 7? Lets say nextpoint == 2. The loop will become infinite because [icode]7 != nextpoint[/icode] is always true. | |
Re: [URL="http://lmgtfy.com/?q=c+program+to+draw+pie+charts"]Here are some links[/URL] If the cobol program writes the data to a disk file then a c or c++ program should be able to read it. | |
Re: If you really want a response then you need to post the code you have done or tried. | |
Re: [URL="http://daweidesigns.netfirms.com/cgi-bin/pointers.php"]Here [/URL]is a good tutorial on pointers. | |
Re: you need some { and }s. [code] while (indata) { if (letter >='a' && letter <='d') { pass++; all++; } else (this is where the error is) if(letter >='d' || letter <='f') { fail++; valid=(pass+fail); } else { outdata<<letter<<endl; all++; indata>>letter; } [/code] | |
Re: You could check before adding it to the vector. | |
Re: >>If the larger number is odd, what happens if the larger number is even ? | |
Re: might be because on or both strings are uninitialized. If you are using a modern compiler its unlikely stack space is the problem. | |
Re: 1) [b]c[/b] must be of type int, not char, because EOF won't fit in a char. 2) Open the file in binary mode and read it one character at a time. The function readFile() is very dangerous because you have no clue how much memory was allocated for the string! … | |
![]() | Re: There are no standard ways to do it. [URL="http://www.programmersheaven.com/mb/CandCPP/150284/150284/password-program/?S=B20000"] Here is one way[/URL] |
Re: There isn't a standard way to do it -- depends on the operating system. You might try calling onexit(), but it may not get called when Ctrl-C is hit. | |
Re: line 71 needs to be [icode]delete[] temp;[/icode] | |
Re: I don't understand what you are asking. How to output the vector in referse order? Just create a loop that counts backwards. | |
Re: >>i need to concatenate the two words Yes, use strcat() for that. [icode]strcat(s1, s2);[/icode] That works as long as the length of the two strings do not exceed the space allocated for s1 (which is 100). >>also somehow need to test to see if the word is a palindrome create … | |
Re: lines 8 and 9. Files can not be opened outside a function like you have it. Move both those lines down to within main() (line 14). line 16: eof() will not give you the file size, it just tells you that the end-of-file has been reached and nothing more. To … | |
Re: You could shift everything after "Happy" left 5 positions to overwrite that text, which will move the empty spaces to the end of the buffer. Since its a binary buffer (I think it is anyway from your description) you can fill the remaining bytes with '\0'. So if the buffer … | |
| |
Re: Two problems: 1) need a return value to return the factorial. Your function does the recursion but doesn't calculate anything. 2) The function's return value should be int, not void. | |
Re: 1) you have to ask nicely :) But we normally don't delete posts unless it violates one or more of the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]DaiWeb Rules[/URL]. 2) Click the "Go Advanced" button, scroll down to "Manage Attachments". | |
Re: [URL="http://www.daniweb.com/forums/thread90228.html"]Read This[/URL] | |
Re: [URL="http://www.daniweb.com/forums/thread90228.html"]Here is an extensive thread [/URL]that discusses how to use it. | |
Re: You will have to lock the queue in order to synchronize the two threads. Disaster will strike your program dead if you allow multiple threads to access a single common object without first locking them. One way to do it is use mutex's. The main thread should create a named … | |
Re: >>line 20: b[i]=(i+1)/10; This is odd coming from a professor. All values of i that are less than 10 will result in a value of 0. Values of i between 10 and 19 are 1, etc. Why would you want to initialize an array with those kinds of numbers? | |
Re: depends on your version of windows. But why would you want to do that anyway? With Vista just copy it to here: C:\Users\<your login name here>\Desktop | |
Re: It doesn't work because on line 7 the array is treated as a pointer, and the size of all pointers in 32-bit compilers is 4. If you want myfunc() to know the size of the array then it will have to be passed as another argument. [icode]void myfunc(const Car A[], … | |
Re: [QUOTE=FrancisC07;830390]Hi! can someone tell me how to count the number of lines?[/QUOTE] I suppose you mean the number of lines in a file??? create an int variable and initialize it to 0. Open the file. Set up a loop to read the file one line at a time using getline() … | |
Re: Its not in the registry, but maintained on a clock cpu chip. [URL="http://lmgtfy.com/?q=how+to+synchronize+time+on+network+computersl"]This is how to synchronize network computers.[/URL] | |
Re: You are probably using VC++ 2008 Express, which by default compiles everything for UNICODE. You have two choices: (1) Turn UNICODE off. Projecct --> Properties --> Configuration Properties --> General. In the controls shown in the right-hand side of the screen look for "Character Set" (3d from the bottom) and … | |
Re: c++ is a lot stricter about typcasting than C. For example, in C it is not necessary to typecase the return value of malloc(), but in C++ it is required. Which one of the lines you posted is line 27? | |
Re: just use two (or more) case statements with no break in between [code] switch(keycode){ case DOWN : case TAB: if(edtIndex == editSize - 1){ fieldPos = edtList[0]; edtIndex = 0; } else if(edtIndex < editSize - 1) fieldPos = edtList[++edtIndex]; break; } [/code] | |
Re: If you want to write your own mini-dos then you can not use the system() function for anything. You can get list of files and sub-directories in MS-Windows by using the FindFirstFile() and FindNextFile() win32 api functions (look them up with google to find exact syntax.) You can find all … | |
Re: on line 21 you need to look up the username in a database and, if found, verify the password. Put lines 10 thru 21 in a loop so that the program can start all over again if the username and/or password are incorrect (not found in the database) Note that … | |
Re: worked perfectly ok for me [code] Enter first number: 10 Enter second number: 20 Sum is 30 Press any key to continue . . . [/code] Perhaps its the compiler you are using -- what compiler and operating system? | |
Re: [quote]Spence drew inspiration for the EyeBorg Project from his tiny cellphone camera and his love of The Six Million Dollar Man[/quote] I liked that tv series a lot -- apparently got very good ratings because it lasted several seasons and had a spin-off. | |
Re: Where did you get those titles in the first list? | |
See post #71 of [URL="http://www.daniweb.com/forums/post827710.html"]this thread:[/URL] Is that link supposed to exist any more? Dani posted it in that thread about a year ago (see post #53) | |
Re: When the error occurs you need to flush the input buffer of all remaining characters. Narue has written an excellent article about flushing the input buffer[URL="http://www.daniweb.com/forums/thread90228.html"] here.[/URL] | |
Re: yummy :) :) But that is certainly a quick way to clogged arteries and heart attack. | |
Re: write a wrapper function such as mywrite() and call it instead of fwrite(). | |
Re: cin won't allow alpha characters to be entered into numeric fields. So when you have [icode]cin >> num1[/icode] num1 will NEVER have 'x' or 'X'. What I would do is get input data as strings so that you can easily determine if the input character is 'X'. Something like this: … | |
Re: Where exactly is Jonathanland? I never heard of it and apparently google hasn't either. | |
Re: [URL="http://lmgtfy.com/?q=win32+api+tutorials"]Here you go![/URL] | |
| |
Re: You will need to make the first field in each record the auto-generated number. Then when you need another number, just read the last record in the file and increment the number to get the next number. If the database is going to be fairly small you can just read … | |
| |
Re: ftell() returns a long int, and the max value is declared in limits.h. If yours is like mine then the 4 gigs is too big. | |
Re: No, you apparently lost. It's not really anything to us if we convinced you not to cheat. Had you studied like you should have then you would not have had to turn in a blank piece of paper as your assignment. You apparently have a bad case of poor time … |
The End.