[c-prog] Re: ascii space problem?That new guy!

2008-11-22 Thread John Matthews
--- In c-prog@yahoogroups.com, Mickey Mathieson [EMAIL PROTECTED] wrote: The problem is the scanf implimentation. When the scanf encounters the space character it signals end of string. So the only character read is 'd'. ...so you could use fgets(): fgets(w, sizeof w, stdin);

[c-prog] Re: ascii space problem?That new guy!

2008-11-22 Thread John Matthews
--- In c-prog@yahoogroups.com, John Matthews [EMAIL PROTECTED] wrote: --- In c-prog@yahoogroups.com, Mickey Mathieson user14312@ wrote: The problem is the scanf implimentation. When the scanf encounters the space character it signals end of string. So the only character read is 'd'.

[c-prog] Re: ascii space problem?That new guy!

2008-11-22 Thread John Matthews
--- In c-prog@yahoogroups.com, John Matthews [EMAIL PROTECTED] wrote: It would be better to use something like: char *c; ...or, if you haven't started using pointers yet: int i, len = strlen(w); for (i = 0; i len; i++) ...

Re: [c-prog] Header file??

2008-11-22 Thread Prince Annan Koomson
Well what i can tell you is that ... listen carefully for the #includestdio.h it is inside the compiler it is system or compiler define header files that has already been build which is standard ASCII C but for the #includestdio.h let say when a header file is inside the directory of your

[c-prog] integer promotions

2008-11-22 Thread Pedro Izecksohn
If The integer promotions preserve value including sign. #include stdio.h int main (void) { unsigned short int a; unsigned long long int b, c; a = -1; b = (a*a); c = ((unsigned int)a*(unsigned int)a); printf (Why %llx != %llx ?\n, b, c); return 0; }

Re: [c-prog] integer promotions

2008-11-22 Thread Paul Herring
On Sun, Nov 23, 2008 at 3:54 AM, Pedro Izecksohn [EMAIL PROTECTED] wrote: If The integer promotions preserve value including sign. #include stdio.h int main (void) { unsigned short int a; unsigned long long int b, c; a = -1; b = (a*a); Here you're multiplying two shorts. c = ((unsigned

Re: [c-prog] integer promotions

2008-11-22 Thread Tyler Littlefield
and you want... what exactly? I seen a sintence, and code... totally undescriptive. Thanks, Tyler Littlefield email: [EMAIL PROTECTED] web: tysdomain-com Visit for quality software and web design. skype: st8amnd2005 - Original Message - From: Pedro Izecksohn To:

[c-prog] Re: integer promotions

2008-11-22 Thread Pedro Izecksohn
--- Tyler Littlefield wrote: and you want... what exactly? I did not express myself well. Let me reformulate my question: --- Paul Herring wrote: Here you're multiplying two shorts. What is the type of result of a multiplication of two unsigned short integers? In other words: Being:

Re: [c-prog] Re: integer promotions

2008-11-22 Thread Thomas Hruska
Pedro Izecksohn wrote: --- Tyler Littlefield wrote: and you want... what exactly? I did not express myself well. Let me reformulate my question: --- Paul Herring wrote: Here you're multiplying two shorts. What is the type of result of a multiplication of two unsigned short

[c-prog] Re: integer promotions

2008-11-22 Thread Pedro Izecksohn
--- Thomas Hruska wrote: The compiler is treating the resulting value as an unsigned integer because that is exactly what you told it to do with typecasting. OK, I wrote a bad piece of code. Let me try to codify my problem again: #include limits.h #include stdio.h int main (void) { unsigned