5,237 Posted Topics
Re: Like a more specific question than "I've got problems, and here's a 3/4 Meg ZIP file for you to dig through" ? | |
Re: Doesn't make much sense here either [url]http://cboard.cprogramming.com/showthread.php?t=110087[/url] | |
Re: rand() should be pretty quick, because it is pretty simple. You might try [code] for ( i = 0 ; i < 1E7 ; i++ ) { num = 42; // was num = rand(); } [/code] Just to make sure that it's rand() which is the bottleneck, and not … | |
Re: It's the same old story - [url]http://www.daniweb.com/forums/thread161400.html[/url] Try it, and find out. Otherwise, we might just start lying about the answer just to see if you'll believe everything we say, only to find yourself with a crap mark on your assignment. | |
Re: > Why are you using a const PIND here? Can its value ever be changed somewhere else in your program? Since the OP mentioned a micro controller, I would say this is an alias for some memory location which maps directly to a hardware switch. > Or any othes ideas … | |
Re: Picture if you will a young man, fresh from college with a nice degree, sitting in an interview for his first job. Things are going well, he expertly answers the simple routine questions designed to filter out the flim-flam artists. Then out of nowhere comes a tough question. "So, what … | |
Re: 23 [url]http://www.daniweb.com/forums/thread161397.html[/url] 14 [url]http://www.daniweb.com/forums/thread161389.html[/url] Is this a live feed direct from my keyboard to your answer sheet without going through YOUR mind? | |
Re: > 14. What will be outputted given the segment of code, if 11 is entered from the keyboard? Why not try it? | |
Re: So where's the if / else logic around your fork calls? Because I can't see how you can possibly get the output, from the code you supply. I mean [code] /* fork process one here */ fork(); pid1 = getpid(); //call process1 to increase shared memory counter process1(); fprintf(stderr,"Hello from … | |
Re: It's because scanf doesn't read a whole line. It only reads what it needs. So if you type 123\n and you remove 123 with your scanf("%d"), then that leaves the \n for something else to deal with. That something else (in your case) is scanf("%c") which reads the next char … | |
Re: My new standard answer to such questions is this. [url]http://www.daniweb.com/forums/post751726.html#post751726[/url] | |
Re: The output of [ICODE]od -Ax -t x1z /home/mmeclimate/test/test.dat[/ICODE] is my preferred way of dumping binary data in an unambiguous textual representation. | |
Re: [url]http://msdn.microsoft.com/en-us/library/aa385103.aspx[/url] 1. You don't check the return result. 2. You don't check ret either 3. Your cout assumes that buffer is a \0 terminated string (it isn't). | |
Re: [url]http://www.daniweb.com/forums/thread159962.html[/url] Well we're not going to explain every last snippet of assembler syntax because you're too lazy to seek out some kind of reference manual. | |
Re: Well here's some [URL="hardware"]http://en.wikipedia.org/wiki/Large_Hadron_Collider[/URL] | |
Re: birdie also needs to figure out code tags in the worst possible way real soon now :( | |
Re: [url]http://www.tomsteyer.com/Illustrations/radar.htm[/url] Distance is how far from the centre Direction is, well I'm sure you can figure it out :) | |
Re: Here as well [url]http://www.daniweb.com/forums/thread161216.html[/url] | |
Re: Why would you need a raw socket, when a regular one would work just fine? Just read "beej" and study the client/server example. | |
Re: You mean this? [url]http://en.wikipedia.org/wiki/Polyhex_(mathematics[/url]) I'm confused by the 20 and 50 - what's that about? They're not multiples of 6. | |
Re: 1. Well done on using code tags, not many 1-posters manage to do that. 2. Here is your code, indented with what I think it actually means. [code=c++] #include "TStack.h" #include <math.h> #include <stdio.h> #include <vector> using namespace std; //FILE *f=fopen("input.txt","r"); //FILE *g=fopen("output.txt","w"); void main(){ int n; scanf("%d", &n); vector … | |
| |
Re: [url]http://cboard.cprogramming.com/showthread.php?t=110012[/url] Solution over there. | |
Re: The first one is initialisation, the second one is assignment. Arrays cannot be assigned in either C or C++. You also need to get out of the "arrays are pointers" mode of thinking. [url]http://c-faq.com/aryptr/index.html[/url] | |
Re: If you can't figure out how to use code tags after 20+ posts, and people keeping on telling you about them, then I have to say that programming isn't for you. And your choice of topic titles borders on the useless as well. [url]http://www.catb.org/~esr/faqs/smart-questions.html#bespecific[/url] | |
Re: Start with [code=c++] readData(cityArr, tempArr); // getHighTemp(cityArr, tempArr); // getLowTemp(cityArr, tempArr); // calcAvgTemp(tempArr); [/code] Does it crash? How about [code=c++] readData(cityArr, tempArr); getHighTemp(cityArr, tempArr); // getLowTemp(cityArr, tempArr); // calcAvgTemp(tempArr); [/code] Maybe this [code=c++] readData(cityArr, tempArr); getHighTemp(cityArr, tempArr); getLowTemp(cityArr, tempArr); // calcAvgTemp(tempArr); [/code] Understand? Or you could use a debugger, which … | |
Re: Well it was suggested in half a dozen places that you should use code tags. But you ignored all of them, so really what would be the point in spending any more effort on a 7th or 8th attempt. | |
Re: There are lots of them. [url]http://en.wikipedia.org/wiki/Widget_toolkit[/url] | |
Re: Well since you bumped a 6-month old thread just to ask a google question, try this [url]http://www.letmegooglethatforyou.com/?q=free+IDE[/url] Which in itself was bumped (uselessly) from a 16 month slumber. But then again, it is your own personal support thread, so perhaps it's OK. | |
Re: > is it true that A. calloc allocates memory in contiguous bytes, malloc does not ensure contiguous memory allocation? No, it's false. calloc is nothing more than malloc + memset to wipe the memory to all-bits-zero. > i mean early intell CPUs could onley address (64K) Only 64K in a … | |
Re: Here's a couple of ascending orders.... [code=c++] int arr[] = { 20,-10,50,4,10,2,6 }; for ( int i = 0 ; i < 7 ; i++ ) { setvolume(i); // 0 is silence, 7 is deafening say( arr[i] ); // number to speech function } int arr[] = { 20,-10,50,4,10,2,6 }; … | |
Re: Convert to a string using say sprintf(c) or stringstream(c++) Then output the string as you know how to. | |
Re: > I'll do it for $500. I'll do it for $5000. | |
Re: trip.input(); trip.set_mile(new_miles,new_fuel); The first one reads input and assigns the class member vars. The second just trashes the data with the uninitialised values in main. Just delete this line. | |
Re: [url]http://docs.sun.com/app/docs/doc/800-7895/6hos0aou4?a=view[/url] Floats are approximations of an infinite number space mapped onto a finite machine. Mathematical results and computational results seldom agree. Any floating point result comes with an error margin. > As I would hate to have to swap to VC++ just to solve this problem If you count sweeping … | |
Re: You test x, and only change y | |
Re: > (Press Retry to debug the application) Do this. When the debugger starts, do something like view->stack That will tell you how the code got to that point. Somewhere through the various stack levels will be your code. Click on the first one you recognise. It should open your source … | |
Re: > This is urgent if any one could please help me resolve the stated issue....... [url]http://www.catb.org/~esr/faqs/smart-questions.html#urgent[/url] > I am Waiting.... I thought it was urgent? Stop sitting on your fingers waiting, and start being proactive in solving your own problems! [url]http://www.mysql.com/[/url] | |
Re: So what's the problem? Stopping when you see a "." ? Reading a line? Extracting words from a line? Or just printing them in reverse? Show us where you can get to yourself. | |
Re: > const char* article[]={"the", "a", "one", "some", "every", "any"} Is (for the compiler) const char* article[6]={"the", "a", "one", "some", "every", "any"} You cannot write a function which will tell you the answer 6. You can do this, which will give you 6 [ICODE]sizeof(article)/sizeof(article[0])[/ICODE] Which can be conveniently expressed as a … | |
Re: [URL="http://www.google.com/search?q=programming+language+design&btnG=Google%20Search"]doing your own homework[/URL] vs. [URL="http://www.letmegooglethatforyou.com/?q=programming+language+design"]spoon-feeding[/URL] | |
Re: The first error was not reading all the forum rules about using code tags. | |
Re: I dunno, 70 posts, and you've managed to figure out code tags. But it's still unindented crap which is hard to read. Translation - you're being ignored. | |
Re: > ReadConsoleInput(stin, inputStat, 1, &NumRead); How about ReadConsoleInput(stin, inputStat, numEvents, &NumRead); > delete inputStat; How about delete [ ] inputStat; You should also check the console API calls for success/failure as well. | |
Re: [url]http://www.letmegooglethatforyou.com/?q=Graphics+in+C+tutorial[/url] | |
Re: > u didnt know what i mean? Oh we know exactly what you mean. It's standard homework which any of the competent helpers here would have no trouble doing in less time that it takes to reply to your thread. But that won't teach you anything like as much as … | |
Re: Well seeing as it took you 3 days to post some actual useful information about the problem, perhaps you could point us to an online manual for the compiler which you're having trouble reading. Better yet, show us that you've tried to understand the manual by pasting some actual commands … | |
Re: You've got this [ICODE] W_line sums; D = (( sums.w * sums.xx) -( pow(sums.x,2)));[/ICODE] Imagine this [ICODE] W_line sums = [COLOR="Red"]{ uninitialised, garbage, here }[/COLOR]; D = (( sums.w * sums.xx) -( pow(sums.x,2)));[/ICODE] What is the value of D given the rubbish you calculate with? | |
Re: > I have a program that's 95% written But 0% tested it would seem. > This should take an experienced programmer less then 30 minutes Sure, but how are you going to learn to clean up your own mess in future? Offer more money? That's gonna get expensive. Your approach … |
The End.