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. Can u please help me. I run the SerialConnection p
View Tutorial          By: Praseetha.K at 2009-01-23 09:34:35

2. Your solution won't work if you have 2 different f
View Tutorial          By: mkieu at 2012-06-19 00:04:29

3. nice one to understand the basic steps of jdbc....
View Tutorial          By: trishna at 2011-06-10 00:04:21

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

5. How to connect a webpage(which I have created for
View Tutorial          By: sam at 2012-01-24 10:10:52

6. good one
View Tutorial          By: vij at 2009-06-03 16:00:12

7. HELP ME HOW TO ANALZE THE PROGRAM??????????
View Tutorial          By: MICHELLE FLORES at 2009-01-21 23:24:52

8. hi Ashray P Shetty,
I want assistance in th

View Tutorial          By: Shabbir Manasawala at 2010-11-19 02:02:43

9. Hello,

your solution is kinda overk

View Tutorial          By: Hdm-Student at 2010-06-16 08:10:51

10. nice example..thanx i was havin trouble wid timers
View Tutorial          By: gunjan at 2008-06-02 03:06:17