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. Thanks for the code. The code runs fine without an
View Tutorial          By: aanube at 2012-08-22 10:12:54

2. hope this may help u

class product<

View Tutorial          By: princess at 2011-11-30 12:11:57

3. This is totally great. Your explaination make me u
View Tutorial          By: Cipom at 2010-04-11 18:41:04

4. good for us
View Tutorial          By: soumen chakraborty at 2008-08-25 01:28:30

5. Nice Article, but these concepts are pretty confus
View Tutorial          By: Goldest at 2011-03-18 01:50:50

6. The synchronization schedule function has been red
View Tutorial          By: Kim at 2014-11-12 10:52:13

7. Currently am working in Perl, lik to learn Java, n
View Tutorial          By: KUMARESAN at 2011-12-14 05:08:47

8. On my blog (http://www.future-edge.nl/blog/adding-
View Tutorial          By: Robert Willems at 2011-11-29 06:26:21

9. I have try this code.
Code has Run succeefu

View Tutorial          By: Avinash at 2010-06-07 05:38:26

10. The concept is clear.
View Tutorial          By: sam at 2012-08-23 03:52:15