| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8
Comments:
<0> lol <1> so can some1 tell me why it doesnt help <1> i mean work <1> why doesnt it work <0> yea just a sec <1> ty <2> g-gao: I just did. but you didn't have the basis to grasp it. you need to learn more about data-types before you start doing things like that. <2> g-gao: first, read this: http://www.catb.org/esr/faqs/smart-questions.html <1> .... <1> codecaine <1> can u help me <2> you need to help yourself <0> take and & sign off the x in the prinf statement <0> printf doesn't read address like scanf <1> yep but when i type a huge number it doesnt work <2> that's because there's no room for it
<1> then how much can it fit <3> In an int? sizeof(int)*CHAR_BIT bits, probably 32 bits <2> 4294967295 is the biggest number you can fit into an unsigned int <1> whats with the 32bits thing <2> divide that by two and you have the biggest number you can fit into a signed one <3> printf("%d",&x); is very wrong <1> isnt 32 bits 4 bytes = 4 characters <2> aha, and, you're printing the address of the variable, not the content. <3> Numbers are stored in binary, not decimal digits <2> g-gao: yes, that would be correct but you must put some meaning into it other than that <1> what do you mean? <2> I mean, what do you do with this info other that state it? <2> s/that/than/ <2> stating <1> nothing i just wanna point out that something is wrong with scanf() <4> (: hi <2> no, that is incorrect, you need to learn how things are affiliated <3> Nothing is wrong with scanf(), you don't understand some fundamental concepts <0> yea <1> what fundamental concepts? <3> Data storage apparently <2> g-gao: the concepts of not being a moron. <2> oops <2> that just popped out <2> g-gao: google c data types. <1> ok <1> so which one do i go to <2> LOL <3> Just read a C book, please <5> t for troll anyone?;/ <2> I think you should go to your mommy; seriously. <2> yeah, this is beginning to look like a troll :) <1> yeh a troll what a loser <1> no im not a troll i just want to know why scanf() and printf() wont let me use a huge number....... <3> Because the number does not fit into an int <1> then what can it fit into? <6> it might not fit into anything. <1> what if i want to work with a really big number... <3> Would 64 bits be enough for you? If not, it won't fit into a single "variable" <6> then you are fooked. <1> 64bits? <3> Then you use gmp <6> at least as far as using standard c. <1> 64 bits is how many numbers <6> you'd need a "bignum" library. <1> i mean digits <6> lots. <1> i thought 64 bit = 8 byte = 8 characters <6> uh. <3> Numbers are not stored in decimal digits in memory <7> 64 bits = 18446744073709551615 <3> They are stored in binary, so it goes up to 2^64-1 which is a lot <6> at least not so far as c is concerned. <7> 18,446,744,073,709,551,615 <1> so numbers are different? <7> 18 bizillion <3> Different from what? <1> characters <1> like "a" <1> coz i know a is 1 byte <1> i read it somewhere .. each character is made up of 8 bits
<3> Characters are numbers too, and these numbers represent a character <3> '0' is 48 <0> 256 for ascii <6> "a" is a string literal. <3> Just read a C book please, it's all going to make sense <1> i dont have a c book <6> 'a' is a character constant, with type int. <0> theres ton online <1> yeh but ive read like 3 tutorials and this hasn't come up <7> quintillion <4> bad tutorials <1> can someone lead me to a good one please? <1> that explains all this? <1> and how data is stored in bits and how many u can store <4> google can <6> i too suggest a book. <6> calc k&r2 <8> Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Second Edition, Prentice Hall, 1988, ISBN 0-13-110362-8, 0-13-110370-9. [K&R2] <1> i dont have the money to buy a book o <6> borrow it from a library. <1> i can do that? <2> I know a good online book <3> Surely there are libraries around? <4> borrow it from a online library <1> can you tell me it plz mrMister <2> but I dont remember the link :) <1> .... <4> try to google <7> calc tutes <8> how would I know ? <7> calc c-tutes <8> http://www.dmoz.org/Computers/Programming/Languages/C/Tutorials/ <7> calc totorial <8> naa, you don't need that <7> calc totorials <8> *You* tell me what is foo <7> searchcalc tuto <8> index: 2750. results: PERL-tut djgpp ipc-tute c++-tute Java-Bible pipes compression-tut java-tute sockets-tute cut motif-tute msgme pckit c-tutes asm-tute tutor Mesa-tut signals ps-tut corba-tut sql-tute win32api compiler bootsector wintute allegro-tute zed3d gtk wrox-tutes hammie_welcome_mat quicksort clisp att_syntax djgpp_asm privmsg ddjcresource tute tute2 libpcap nehe threads javatutorial <7> calc tute <8> We've had this issue come up before. The perfect tutorial for your problem lies in: http://www.amb***or.com/tutes/tute.htm <7> calc tute2 <8> This tutorial will help you acquire the proper books and/or compilers you need to get your coding done : http://www.amb***or.com/tutes/tute2.htm <1> .... <0> lol <1> plz i need a good guide <1> ints and floats are often 32-bit, chars 8-bit, and doubles are usually 64-bit. bools are often implemented as 8-bit data types. <1> what does 32 bit mean <1> i dont get it.. <1> how much can u store in 32 bit <3> It means it takes 32 bits when in memory <1> yeah 32 bits <1> in the memory <9> you can store 2^32 different values in a 32-bit variable (roughly 4 billion) <9> 32-bits -> 4 bytes (on most computers) <1> yes <3> You can store 32 bits of data, 32 times 0 or 1. You can either use that for a single 32 bits number ( 0 to 4 billion ), 4 ASCII characters, a float with a mantissa and exponent, and so on <1> oh i see <3> Don't mix up integer variables stored in binary, and ASCII characters... <1> yeh :p <1> wow thats a lot more <1> so 0 takes up how many bits in binary <9> g-gao: depends upon what type you're storing 0 in <9> are you storing 0 in a char? in a short? an int? long? float? double? <3> Any number of bits can handle zero. Well, at least one bit that is <1> an int <9> an int is typically 32-bits. <3> An int is sizeof(int)*CHAR_BIT bits no matter what you put in it <1> if you can store roughly 4 billion in an int then howcome it can only print back a few digits <9> int myint = 2000000000; printf("%d", myint); // should display 2 billion <0> how I have to try c with gcc <0> you can use like grep and crap too <0> :p <9> on a typical compiler, an int can represent -2 billion to 2 billion, since that 4 billion different values needs to be split between negatives and positives
Return to
#c or Go to some related
logs:
apuzilla #fedora #politics #nhl #politics #politics #solaris school poroxies pc2800 ddr2 #microsoft
|
|