15,300 Posted Topics
Re: How to use fgetc() to read the file one charactger at a time. Note that chrLetter should be int not char because fgetc() returns int. int chrLetter; while( (chrLetter = fgetc( pfilInput ) != EOF) { strBuffer[Index++] = chrLetter; } If you are not required to use fgetc() then I'd … | |
Re: Your program looks nice but your use of boost library is probably not allowed in his program. It's like hitting a nail with a sludge hammer, way too overkill. | |
Re: > Do you guys miss having views? No. I can live quite nicely without them. | |
Re: I've also noticed that every since Dani upgraded to the new forums. There were a lot of threads that indicated Dani was the last poster, but if you go to the last post in the thread she is not there. | |
Re: maybe you should ask that question in the [Acrobat SDK forums?](http://forums.adobe.com/community/acrobat/acrobat_sdk?view=discussions) | |
Re: > As for int 3, forget it. Yes, because the operating system won't let your program execute interrupts. The processors on Intel based computers do not allow normal programs to use int instructions. [Here](http://faydoc.tripod.com/cpu/int3.htm) is more info about int 3 if you are really interested. | |
Re: pass them just like you would any other variable void foo(int matrix[][5]) { } int main { int matrix[10][5]; foo(matrix); } | |
Re: why do you have a loop? There is no need for it in your example. | |
Re: Sounds like its related to [this thread](http://www.daniweb.com/community-center/daniweb-community-feedback/threads/427471/browser-goes-crazy) | |
Re: you need to use an intermediate integer. int a,b,temp; temp = a a = b b = temp | |
Re: It looks like all you get is the library's source code. You will have to compile the library yourself to generate the \*.lib or \*.dll | |
Re: Yes, the default value of global variables is 0, that's not an error message. And the compiler is warning you that you did not put any code within the body of function main. That's also not an error. What compiler and operating system are you using? I don't know why … | |
Re: The program exits because main() did not wait for the thread to complete its task. You need to create a mutex then call [pthread_cond_wait()](http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_cond_wait.html) | |
Every once in awhile I get email from my web site vBulletin that there is an error on MySQL. Below is the most recent error message. Looks like it might be caused by a hacker to me, what do you think? I've asked the technicians at iPage and they have … | |
Re: > MinGW now supports version 4.7.0 I just installed the latest and greatest -- it's up to 4.7.8 | |
Re: You should never ever use gets() because it will allow you to enter more characters then the buffer can hold, excess characters are just scribbled all over memory and your program will crash. There are a couple ways to avoid that problem 1. fgets() -- e.g. fgets(name, sizeof(name), stdin); The … | |
![]() | Re: [Here](http://en.wikipedia.org/wiki/C_preprocessor) is a good wiki article about preprocessor directives. As for your program. This may compile, but it won't work because it's recursive. main() should never be called by your program. int fun( int foo() ) { return foo(); } int main() { fun(main); } |
Re: what compiler are you using? Did you try using your compiler's debugger to find the problem? If you don't know how to do that then right now is a good time to start learning how to use it. Can't you just call the standard C function atof() to convert a … | |
![]() | Re: > if ((&chouseing_alphabet[0] == abc[0]) Why are you trying to compare the address of a variable with the value of another variable? abc[0] is not an address. If you only want to compare the two characters then remove the & address operator. |
![]() | Re: cin.fail is not used to keep the screen open -- it is used to simply test to find out if cin succeeded or not. If you want to keep the screen open call cin.get(). ![]() |
![]() | Re: I can't help you with converting to java, but if you expect anyone to actually read your program you need to format it better. Make liberal use of spaces to make your code easier to read. For example, here's the first few lines of your program #include <stdio.h> #include <stdlib.h> … |
Re: Depends on what you mean by "remove". If you just want to change the nonalphas to something else then use the previous suggestion. Otherwise if you have to move the remaining charactes around to fill up the gaps then you need to create a loop to look at each character. … | |
Re: You need to have another counter that stores the index value of the highest number then add another line to the if statement on line 20 to set that integer to the current value of i loop counter. Don't forget to put { and } around that if statement. | |
Re: It depends on the operating system you want to use. On MS-Windows you need a c and/or c++ compiler, such as free Code::Blocks with MinGW compiler or VC++ 2010 Express. On \*nix you can use free gcc or g++ compilers. You can create/compile programs for other operating systems by using … | |
Re: you can not delete arrays or other objects that were not allocated with new. All you have to do is delete line 85 because its not needed. | |
Re: In c and c++ languanges arrays do not have negative index values. If you tried to print that then it is by coincidence that the program worked at all. One reason it may have worked for you is if you declared two integers just before you declared the array so … | |
Re: The file was written on one operating system such as MS-Windows and you are trying to view it on another os such as *nix. The only way to remove those rectangles is to translate the file from MS-Windows to *nix. MS-Windows uses two bytes as a line terminator -- "\r\n" … | |
Re: You have not populated the vector v with student class objects. After you do that then you can call std::sort() to sort the vector. pass std::sort() the cmp() function you have already written as the last parameter. | |
Re: > Strange i run into more errors with C++ than C. C is an older language, but c++ is a much stricter language. There are lots of things that you can get away with in C that you can't in c++, and C will let you hang yourself a lot … | |
My computer has USB keyboard and mouse. After using the Windows installer to install Ubuntu on my system and rebooting, the duel-boot menu popped up where I can select either Windosw 7 or Ubuntu. The problem is that my keyboard doesn't work at that point because it is USB, so … | |
Re: delete line 6 and just make normal assignments inside he function. AFAIK you can only do what you did on line 6 with class reference variables, which id_ and name_ are not. | |
Re: maybe once a second is too frequent -- slow it down to once every 15 seconds and see if it still gives errors. | |
Re: Interesting ... but you failed to ask the question, or I failed to find it. | |
Re: Your program is missing { and } around the if statement because the if statement consists of multiple lines if(numArray[i]%2==0) { printf("%d", numArray[a]); total+=numArray[a]; } Line 20 also has a problem: variable n was never declared, and the result will only be an integer because ave is an integer. | |
Re: remove the brackets on lines 15 and 18 because they are not necessary. Also format the program a little better to make it easier for you to follow the flow of the program. #include<stdio.h> int main() { int numArrays[] = {2, 67, 23, 5, 7, 34, 14, 4, 8, 62}; … | |
After posting code using the Code button no line numbers appear and I can't double-click to highlight the posted code. See [this thread](http://www.daniweb.com/software-development/cpp/threads/428146/wats-wrong-with-this-code-calculating-the-average). Everything works correctly in the original post to that thread, but not in mine where I used the Code button. | |
Re: what does it do or what does it not do that you want it to do? We need a bit more information about that the problem is. I can tell you that you don't need line 29. Please don't create new threads to ask additional questions about the same problem, … | |
Re: line 5: remove "Dim ;" -- that's not a valid statement line 7: remove the ; from the beginning of the line and put it at the end of the previous line line 18: The number of parameters and type of parameters must match exactly with those shown in the … | |
![]() | Re: I mean [this button](http://developers.facebook.com/docs/reference/plugins/login/) ![]() |
Re: After creating the command prompt window you have to add the dev-cpp\bin to your PATH environment then execute make.exe [quote] c:\Dev-C++:>make -f makefile.win <Enter>[/quote] The makefile.win should have been generated by the Dev-C++ IDE. If not, then you will either have to learn how to create it manually (its a … | |
Re: Yes, use call Sleep() to make the program pause for the desired about of time then rewrite the text. #include <iostream> #include <windows.h> int main() { cout << "Hello ..."; Sleep(2000); // wait for 2 seconds cout << "How are you?\n"; } It's something similar with Windows Forms or MFC … | |
Re: > I'm hoping for someone hopefully with a law background to give me an overview of what needs considering. That's not advisable -- its similar to asking someone with a little medical training to give you advance about an operation. Go see a licensed lawyer for legal advice, and go … | |
Re: You don't need to decompile a compiled program just to read the strings, any program such as debug.exe will easily display that along with the hex values of all the non-text bytes. | |
Re: Here isn't much to them. [Here](https://www.google.com/#hl=en&sclient=psy-ab&q=pragma+directive+in+c&oq=pragma+direc&gs_l=hp.1.1.0l4.0.0.1.171.0.0.0.0.0.0.0.0..0.0...0.0...1c.tEpiMglhB3c&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=158101d518659935&biw=1174&bih=545) are some links you should read. Not all compilers implement them. | |
Re: You have to have admin privledges to do what you want to do. It's a security thing. Security would be severly breached if just anyone could view passwords. | |
Re: Serial communication is inherently sloooow, which is one reason hardware manufactures switched to USB. This is one are in which MS-DOS 6.X did a lot better than MS-Windows or \*inix because MS-DOS was pretty close to a real-time operating system and programmers had complete access to the hardware and ports. | |
Re: > Anybody else excited about this? Not really. Its about as exciting as a wet noodle. The discovery of DNA was indeed very exciting because it affects our every day lives. Maybe in a few years my attitude about it will change once we know how, or if, it has … | |
Re: > PLease help me in adding files to this code is it very simple for What exactly is your question? What compiler? what operaring system? WWat do you want the files to contain? Please explain your needs in greater detail. |
The End.