Comment on Tutorial - Binary Tree - (Self-referential Structures) example program in C By Daniel Malcolm



Comment Added by : Vinod S

Comment Added at : 2011-12-02 07:53:52

Comment on Tutorial : Binary Tree - (Self-referential Structures) example program in C By Daniel Malcolm
/* getword: get next word or character from input */
int getword(char *word, int lim)
{
int c, getch(void);
void ungetch(int);
char *w = word;
while (isspace(c = getch()))
;
if (c != EOF)
*w++ = c;
if (!isalpha(c)) {
*w = '\0';
return c;
}
for ( ; --lim > 0; w++)
if (!isalnum(*w = getch())) {
ungetch(*w);
break;
}
*w = '\0';
return word[0];
}

int getch(void)
{ /* get a (possibly pushed-back) character */
return (bufp > 0) ? buf[--bufp] : getchar();
}

void ungetch(int c) /* push character back on input */
{
if (bufp >= BUFSIZE)
printf("ungetch: too many characters\n");
else
buf[bufp++] = c;
}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Thank you very much you resolved my issue.
View Tutorial          By: ketan at 2012-02-01 11:16:47

2. Hey guys, can u help me out over here..
thi

View Tutorial          By: Ridge Fernandes at 2012-01-19 04:09:45

3. hey usharadha and all other friends...i hv taken a
View Tutorial          By: abdur at 2012-02-03 15:56:10

4. hi sir can you help me with this problem

View Tutorial          By: Lee at 2015-10-01 09:08:26

5. I am using my NOKIA 6630 via usb connection, runni
View Tutorial          By: muhin at 2010-04-19 21:37:02

6. Hi, it looks great!
I'm just starting with

View Tutorial          By: Bertrand at 2013-04-28 19:20:42

7. I don't think GSM/Modem simulatur, will get it wor
View Tutorial          By: Michael Chon at 2008-10-08 10:35:55

8. Thanks, I understand the add function better now (
View Tutorial          By: Venus at 2011-02-11 09:09:55

9. Hi
I am newly in java. I have one dought.

View Tutorial          By: Dinakar at 2008-07-26 01:13:08

10. Really Good........!
View Tutorial          By: Anonymous at 2009-04-01 22:33:19