1,265 Posted Topics

Member Avatar for crash1989

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 …

Member Avatar for crash1989
0
642
Member Avatar for xyzt

[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 …

Member Avatar for tux4life
0
131
Member Avatar for XTRobot

[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 …

Member Avatar for Stefano Mtangoo
0
241
Member Avatar for mamabile
Member Avatar for mamabile
-1
58
Member Avatar for dombit

[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), …

Member Avatar for MosaicFuneral
0
143
Member Avatar for scru
Member Avatar for jbennet
0
332
Member Avatar for The Dude
Member Avatar for ganesh_bala

EDIT: never mind. [URL="http://lmgtfy.com/?q=mulitple+precision+library"]find it yourself.[/URL]

Member Avatar for Hiroshe
0
141
Member Avatar for RoninMastaFX

^ 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 …

Member Avatar for jephthah
0
134
Member Avatar for tux4life
Member Avatar for srishekh

[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?

Member Avatar for WaltP
0
595
Member Avatar for Nikhar

[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 …

Member Avatar for siddhant3s
0
332
Member Avatar for Punkis448

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 …

Member Avatar for siddhant3s
-1
932
Member Avatar for patrick k

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 …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for yila

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]

Member Avatar for yila
0
789
Member Avatar for book_worm

[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! .

Member Avatar for kangarooblood
0
363
Member Avatar for razsadeq

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", …

Member Avatar for razsadeq
0
2K
Member Avatar for mysong

perhaps you can try something like this. [code]if (critera) { // do whatever } else { // do something different }[/code]

Member Avatar for Salem
0
2K
Member Avatar for JugglerDrummer
Member Avatar for MidiMagic
0
241
Member Avatar for fghdmhmmd
Re: SLR

[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 ? …

Member Avatar for jephthah
0
215
Member Avatar for edenn1

why do you need a helper function? seems that all the work is being done there anyhow.

Member Avatar for WaltP
0
104
Member Avatar for jephthah

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 …

Member Avatar for scru
1
176
Member Avatar for jephthah
Member Avatar for csurfer

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 …

Member Avatar for GrimJack
0
332
Member Avatar for MrNoob

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 …

Member Avatar for Tom Gunn
0
376
Member Avatar for ADCgal
Member Avatar for seemant_sun
Re: Help

"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 …

Member Avatar for jephthah
1
115
Member Avatar for matt4615

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 …

Member Avatar for VernonDozier
0
840
Member Avatar for andy126

andy is damned and determined to pound those square pegs into some round holes. bummer. i was looking forward to some cool Narue code. .

Member Avatar for jephthah
0
161
Member Avatar for Engineer.Saleh

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 …

Member Avatar for Jupiter 2
0
1K

The End.