RE: A quick c question

  • From: Daniel Dalton <d.dalton@xxxxxxxxxxxx>
  • To: blind programming <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 13 Mar 2008 08:27:41 +1100 (EST)

Hi,

One more question:
What is a bit patton in C exactly?
And in the following program why can't we use a char instead of an int?
Wouldn't a char be better suited?
My book says its not big enough for this though.
Aren't chars meant to hold characters?
Like if the user entered 20 characters would this work?
char [20];

Thanks for any help, And my program with the int is below...


Start code:

#include <stdio.h>

int main (void)
{
     int c;

     while ((c =getchar()) !=EOF)
                         putchar (c);

     printf("%d\n", c);
     return 0;
}


Thanks,

--
Daniel Dalton

http://members.iinet.net.au/~ddalton/
d.dalton@xxxxxxxxxxxx
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: