1,265 Posted Topics
Re: the formula posted by siddhant is fundamentally flawed. it only appeared to work, because it just happened to be valid for n=2 through n=8. as 'n' increases past 8, the result becomes more and more inaccurate. n=9 to n=11, the result is off by 1 n=12 to n=14, the result … | |
Re: [QUOTE=Tom Gunn;897794]you don't have to initialize every member before the one you want to initialize. 0 is the default, so if I wanted to only initialize third, the old way is still the same but the new way is easier...[/QUOTE] Wrong. Wrong. Wrong. Structures, or any other variable, are [B]not … | |
Re: [QUOTE]Hi,first i must say this is not my homework,because i am to young (14 Years old)to have programming homework.[/QUOTE] that's ridiculous. 14 y.o. is High School, and you are certainly old enough to have homework in a programming class. furthermore this is a typical standard homework problem. i'm not saying … | |
Re: [QUOTE]Statistics on barking dogs[/QUOTE] good lord, that's funny. but i don't think the OP is interested in buying a commercial product to submit as a school project or whatever he's trying to do this for. a Do-It-Yourself project, i think you will need a sensor to detect sound (a microphone), … | |
Re: americans have better teeth and nicer tans. we're also generally fatter. | |
Re: EDIT: never mind. [URL="http://lmgtfy.com/?q=mulitple+precision+library"]find it yourself.[/URL] | |
Re: ^ what he's saying is that you should *never* use the "equal to" comparison operator for floating point variables. while his vocabulary wasn't precise about the type of comparison operator, he's correct that you should never use the "equal to" comparison operator to compare floating points. instead use the greater … | |
Re: [QUOTE=perseus31;898368]i don't think you can use the concept of 200 pages to measure time accurately.[/QUOTE] but you can wait 3 1/2 years to respond to a thread and divide that time by the number of total posts, for a rough estimate of the number of thread-posts per year. amirite? | |
Re: [QUOTE]The problem is the way we are taught in school. In school, we still use #include<iostream.h>,#include<conio.h>,getch(),clrscsr()...etc.etc....[/QUOTE] I say that you should avoid the use of old, non-standard libraries like "conio.h" unless you are explicitly instructed -- required -- to do so. anyone can quickly learn to use any library function … | |
Re: i notice your function is called: "ha[B][COLOR="Red"]n[/COLOR][/B]ming" ...but i imagine you would easily figure out a compile time error such as that. otherwise, i dont really have fooking clue as to what "calculating [URL="http://en.wikipedia.org/wiki/Entropy_(Information_theory)"]entropy[/URL] of a file and coding it using [URL="http://en.wikipedia.org/wiki/Hamming_code"]hamming[/URL]" means. To be honest, I was thinking of … | |
Re: here's one problem that immediately jumps out: [code=c]leapyr (year); if (leap == 1)[/code] you need to assign the variable leap to the return value of the function [code=c]leap = leapyr(year)[/code] but, more importantly, you should really consider using the standard C library <[URL="http://www.cplusplus.com/reference/clibrary/ctime/"]time.h[/URL]> pay attention to the time_t and tm … | |
Re: what salem said. and, anyhow, if you really want to do this correctly, you will use the standard C library [URL="http://www.cplusplus.com/reference/clibrary/ctime/"]<time.h>[/URL] ... you will make use of the time_t type, and the structure tm. [URL="http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.15.html"] here is a tutorial[/URL] | |
Re: [QUOTE=book_worm;895053]Hello World! i want to write a program[/quote] awesome! [quote]Can any one help me!?[/quote] sure can! [quote]Thanks in advance![/QUOTE] you're welcome! . | |
Re: as already stated, never try to use strings as cases for a switch. Some languages (like Perl) will allow this. C will not. you could, for instance, try something like this: [code=c]void read_snum(char *sno) { int courseNum; courseNum = atol(sno); switch(courseNum) { case 1: printf("\n%s\n", 'one'); break; case 2: printf("\n%s\n", … | |
Re: perhaps you can try something like this. [code]if (critera) { // do whatever } else { // do something different }[/code] | |
Re: or if you use FF and ABP, you dont ever have to worry about any site ads, anywhere, ever. | |
Re: [QUOTE=fghdmhmmd;895365]no,this is a C language program,i test it,this code is run,but don't work correctly,i don't know why work incorrectly!confused[/QUOTE] no, this is C++. Not C. Which is probably a lot of your problem: you're confusing two related, but different, languages. [QUOTE=fghdmhmmd;895364]please help me ? where i give my answer ? … | |
Re: why do you need a helper function? seems that all the work is being done there anyhow. | |
Dear little Greek letter Omega, how do I love thee? Let me count the ways. Your smooth lines and the parallel symmetry of your gently swelling curvatures, descending in a pendulous manner before convexly arising to cleave together at your magnificent center. Damn the font size 12! You shall always … | |
Re: there's no such thing as a truly random number. all random number generators are pseudo-random. the difference is that some generators are better than others, in that their sequences are harder to predict than others, given current computing technology. in other words, we have number generators that are, for all … | |
Re: take the example: given x=0x55 (dec 85, binary 01010101), p=6, n=5, and y=0xEE (dec 238, binary 11101110) what you want to happen is this: [code] x= 01010101 (0x55, dec 85) p=6 ^ (bit #6) n=5 ..... (get 5 bits) -10101-- (extracted from 'x'. '-' are zeros) y= 11101110 (0xEE, dec … | |
Re: "thorough knowledge"? but little practical experience?? LOL :) sorry bud, you don't have a thorough knowledge of C, until you gain [B] lots[/B] of experience. i've been programming C for years and the more i program the more i realize i don't know. in fact, i really don't know a … | |
Re: think about the typical Lotto game, and how the numbers are selected: you have 40 balls rolling around in a container from which 6 are picked, one at a time, at random. after each successive pick, the pool of available numbers able to be selected is reduced in size by … | |
Re: andy is damned and determined to pound those square pegs into some round holes. bummer. i was looking forward to some cool Narue code. . | |
Re: Yes. You can... "Engineer Saleh" So, I can't help but notice you have vaingloriously put the professional title "engineer" in your name I wonder, have you earned that right by passing a core competency professional exam or working for several years as a professional in the field? if so, you'll … |
The End.