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. Hi

Anybody plz send me the sms send

View Tutorial          By: Venky at 2008-11-19 08:33:22

2. hi.....
if we have number of fieldsl ike na

View Tutorial          By: shailesh at 2011-12-15 07:10:34

3. realy i enjoy it for visit your site. and i unders
View Tutorial          By: vinod balot at 2015-02-09 17:43:30

4. Bitwise OR is a pipe (|), not a logical NOT (!)
View Tutorial          By: Martijn at 2011-06-21 10:49:29

5. hello
thanks for your code
It works

View Tutorial          By: m_karimi at 2008-10-24 12:08:06

6. someone explain how to use PreparedStatements with
View Tutorial          By: Manikprabhu at 2011-03-26 00:04:54

7. A phone is considered a good phone if all of the f
View Tutorial          By: harish at 2012-12-24 06:59:04

8. can you give the program about the fast food by us
View Tutorial          By: grace at 2008-09-22 00:48:37

9. can i have a piece of program so that i can improv
View Tutorial          By: miniboss at 2010-11-12 06:09:41

10. How to fetch a value from a database in dropdown b
View Tutorial          By: lara at 2014-11-19 09:02:43