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
I have final project whit sms program.
View Tutorial          By: AliPour at 2011-09-11 16:51:19

2. I think the programmer overlooked that "this
View Tutorial          By: Joe Schmoe at 2010-10-16 00:01:27

3. Thanks for this tip -
I'm currently workin

View Tutorial          By: Helen at 2009-06-16 05:28:24

4. Hi Ramlak,
Am getting
Sat Jan 17 13

View Tutorial          By: Shiv Kumar at 2009-01-17 02:01:01

5. thanks excellent explanation!!!!!!!!
View Tutorial          By: divya at 2012-01-01 17:37:32

6. please give very easy program....this program is d
View Tutorial          By: rajesh at 2010-01-24 08:08:38

7. its giving exception
javax.comm.NoSuchPortE

View Tutorial          By: Dc at 2012-06-07 04:08:19

8. Can u please help me to implement traversing forw
View Tutorial          By: Rahi at 2015-09-18 11:12:32

9. very good....
View Tutorial          By: satish at 2010-03-03 22:47:25

10. hi,this is nishad from india.....
i have a

View Tutorial          By: NISHAD at 2008-09-06 09:23:15