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



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. thnks lot 4 helping me
View Tutorial          By: sandeep dudi at 2011-11-17 06:06:03

2. i m new in java plz send some programs of java usi
View Tutorial          By: supriyo at 2009-09-02 02:03:38

3. how to comapre two hash map
View Tutorial          By: vinay at 2013-05-03 10:21:57

4. Hi, from where i can download javax.comm API jar f
View Tutorial          By: Chandra at 2008-11-19 11:49:46

5. Awesome, now I can say I've fully understood volat
View Tutorial          By: Andrew at 2012-01-13 18:19:15

6. excellent for a beginer in inet address ...
View Tutorial          By: Tony at 2009-08-13 22:39:48

7. very excellent1!!!!!!!!!!!!!!!!!!!!!!!!!!!
View Tutorial          By: santosh manchala at 2010-10-10 13:07:07

8. Great Article! Thanks
View Tutorial          By: Rachid at 2011-06-21 13:01:39

9. i like java language.
View Tutorial          By: deepika at 2014-09-22 15:11:39

10. This works great, just remember to add <uses-pe
View Tutorial          By: Nick at 2012-06-20 07:37:15