5,237 Posted Topics
Re: That depends on your OS/Compiler and type of application. | |
Re: I was thinking, what's the point of all the "read before posting" messages. [url]http://www.daniweb.com/forums/announcement8-3.html[/url] [url]http://www.daniweb.com/forums/thread78223.html[/url] Not to mention, gets() [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1049157810&id=1043284351[/url] | |
Re: Your array / struct contains an origin city in every entry of the array, but you only read it once. Consider storing this information separately. | |
Re: At least learn to read the forum rules and how to post code before puking a 1000 lines of unformatted code on the board. | |
Re: Strange that, I feel no sense of urgency at all. [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] Try a job offers site. This forum is for people who want to learn. | |
Re: Whilst not having anything to try it on, I would have at least given this a go. [ICODE]system( "c:\\cygwin\\bin\\bash.exe -l -c ls" );[/ICODE] -l means it's a login shell, so it runs the .profile and .rc files, to set up paths -c means run the command line and exit. You … | |
Re: [url]http://www.daniweb.com/forums/announcement118-3.html[/url] [url]http://www.daniweb.com/forums/thread78060.html[/url] | |
| |
Re: Arrays are good for that. As would indenting your code, and deleting all the commented out code before you post it to a forum. | |
Re: All the printf formats for the data types you're trying to print are also wrong. Also, tell us which OS/Compiler you're using because "long long" is a C99 feature, and support for that is not that widespread. | |
Re: Typically you run the calculation through the ALU and then examine the overflow and carry flags in your branch logic. | |
Re: You've been lurking, and that was the best title you could come up with? :icon_rolleyes: [url]http://www.catb.org/~esr/faqs/smart-questions.html#bespecific[/url] Plus you missed all the hints to use code tags, and if you had been lurking, all the comments telling people to use code tags, and obviously, nicely formatted code as a result. Yours … | |
Re: Arrays are always passed as a pointer, so using &myArray seldom buys you anything. Just use the array name when you call the function, and take a * out of your function prototypes and definitions. | |
Re: > scanf(i); Have you any idea how dangerous this is? > What is the cause of above weird results and how to avoid it? I see nothing weird about it at all, and it implements what you wanted to implement. Your mis-conception is that every write by the parent immediately … | |
Re: 1. you get eof 2. it's your responsibility to validate data - get it wrong and your program is hosed. 3. pay attention to the return status of write functions. | |
Re: The same thing using a pointer would be [ICODE]char *word = malloc( 21 * sizeof *word );[/ICODE] | |
Re: Perhaps you could care to elaborate with a more descriptive problem than "it doesn't work". Seems to work for some people. [url]http://www.topshareware.com/Easy-Code-for-Masm-download-52102.htm[/url] | |
Re: Why are you trying to do half a job by preserving the header in clear text? avi | encrypt > secret secret | decrypt > avi Or even secret | decrypt | player | |
Re: > i was not able to understand the :i(j) in line 4 It initialises i (you member variable) with j (the parameter). Compare with[ICODE] integer (int j = 0) { i = j; };[/ICODE] which is an assignment. [url]http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6[/url] > const which is at the end of line 5. What … | |
Re: > what kind of processes uses this code ? Things in a producer / consumer relationship of course. Say an application sending data to a serial port via a serial port driver. The shared buffer is filled by one process and emptied by another, and access needs to be protected … | |
Re: Compare "learning to drive (any car)" with "choosing a Ferrari because it's red and fast". The same applies to programming; Learn to program, then choose a language (or indeed several languages, depending on what problems you want to solve). | |
Re: Have you drawn your rectangles on paper, and annotated the diagram with the values you know. It will help you visualise what you need to do. | |
Re: Only if you run it in real mode. [url]http://en.wikipedia.org/wiki/Category:X86_operating_modes[/url] | |
Re: > scanf( "%d",year); You need &, as in scanf( "%d", [COLOR="Red"]&[/COLOR]year);[/ICODE] You should also start using a compiler which will warn you about printf / scanf format string errors before you get to run your code and have it fail in a variety of interesting ways. gcc -W -Wall -ansi … | |
Re: struct [COLOR="Red"]places[/COLOR] { char places1[100]; char [COLOR="Red"]places[/COLOR][10][10]; Pick a different name. Your use of feof() is wrong as well. [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351[/url] | |
Re: decimal or hex makes no difference, since it's all binary to the machine. int x = 10; int *y = (int*)x; y is now 0xa, without you having to do anything special at all. | |
Re: > Maybe an even number adds up to 3 primes summed up or even more? The sum of 3 odd numbers will always be odd, like the sum of two odd numbers will be even. What you're suggesting is there are other primes which are even. | |
Re: Why are you using open() and fopen() ? > while(fscanf(In,"%s",&TTT) != EOF) Post an attempt which uses this construct, because that would be my initial attempt. [ICODE] while ( fgets( buff, sizeof buff, In ) != NULL ) [/ICODE] would be a better approach, as it protects against buffer overrun. | |
Re: Wow, apart from the project and the timescale, the wording is nearly identical. [url]http://www.daniweb.com/forums/thread116831.html[/url] | |
Re: Perhaps you should explain what a "lrpd test" actually entails. | |
Re: Personally, I'm astonished you've got that far with Miracle C. Get a real compiler (one of the GNU ports, say [url]http://www.codeblocks.org/)[/url]. | |
Re: Yes, that's right. Now return the result of the recursive call and you're almost there. That applies to your other threads as well. | |
Re: > All this from another external application (written in C). So is this application interested in any way as to what "A | B" does ? Does it say - collect the output of B - get the exit status of A | |
![]() | Re: > More important, is the result in IEEE Floating binary point format (standard 754) or some other format. No idea - read your compiler documentation to find out how it represent floats. If you're mapping 000h to 0 and FFFh to 4095, then just leave it as an integer. Or … |
Re: Post an attempt - and mention your OS/Compiler.. | |
Re: Something along the lines of (you'll have to look up the exact MIPS syntax, I haven't used it in ages) [ICODE].array: db(100) ; reserve a block of 100 bytes[/ICODE] If you want to sythesise say [ICODE]char array[5][20];[/ICODE] it would be something like [CODE]move %r0,@array ; the start of the memory … | |
Re: Or even [url]http://nehe.gamedev.net/lesson.asp?index=01[/url] | |
| |
Re: > void main(int argc, char **argv) main returns an int. > int map[60][40]; The for loops which access this seem to think it's a [40][60] array. > MPI_Recv(&oldrow,oldcol,newrow,newcol,1,MPI_INT,i,246,MPI_COMM_WORLD, &status); 1. where does 246 come from, it looks like a magic number to me. 2. newrow and newcol are uninitialised. > … | |
Re: Well that would depend entirely on your OS. gcc in itself has no idea about graphics of any sort, it's all down to one or more libraries which interface to your specific OS. A simple example might be to use ncurses, which is a nice simple console based API for … | |
Re: I guess you use 0 to 9 for 0 to 9, then say A for Addition, B for suBtraction etc. Do you also have somewhere to display the answer? | |
Re: So what's YOUR effort so far? Have you read up on some of the functions you've been told would be good to look into? | |
Re: Between every fwrite() and fread() call, there should be a fflush() call. I hope this is limited to a small number of unsorted records at the end of the file, because this approach is going to take some time. | |
Re: > send(sClient, buffer, strlen(buffer), 0) 1. You already have the size of the buffer in your size variable. 2. strlen() will return at the first \0 in your binary data, or the first \0 in some random location beyond the end of your data 3. send doesn't guarantee to send … | |
| |
Re: [url]http://clusty.com/search?query=comct232.ocx+visual+studio+installation&sourceid=Mozilla-search[/url] | |
Re: > this link was very useful Are you kidding? You posted a URL full of dots, so it doesn't resolve for me. But then again, you also posted initgraph(&gdriver,&gmode,"c:\\tc\\bgi... which is another unterminated string, so it won't even compile. Attention to detail man! | |
Re: The forum is neck-deep with all sorts of homework problems. Why not just read through some of them to see if there are any problems you like the look of and would like to try to solve yourself. Just don't post a complete answer to someone's request for help, should … | |
Re: ca[4] for example, is a single char, not a string. So for each ca[x] you want to print, you need a %c in your format string. |
The End.