--- 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);
--- 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'.
--- 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++)
...
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
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;
}
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
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:
--- 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:
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
--- 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
10 matches
Mail list logo