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

Java program to get location meta data from an image

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

Archived Comments

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

2. somebody help me doing my case study .. its a rese
View Tutorial          By: lady at 2013-12-25 08:21:03

3. Unable to connect with https:\\localhost:8443 but
View Tutorial          By: gopala krishna at 2012-04-02 07:17:09

4. Verrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
View Tutorial          By: Amarnath.A at 2011-07-14 00:32:08

5. Once i run it gives the following error.Why "
View Tutorial          By: IDK at 2008-12-18 19:56:12

6. Awesome information
View Tutorial          By: Pavan Somu @ Tech Tips at 2013-01-03 18:45:30

7. //EXAMPLE OF NESTED IF*****
//FIND OUT BIGE

View Tutorial          By: Amitava Misra at 2009-11-03 06:11:33

8. You should consider using different threads that a
View Tutorial          By: Jeremy at 2010-01-13 23:02:11

9. can u pls tell me how to retrive data from databas
View Tutorial          By: yogesg desai at 2010-05-27 08:26:24

10. my requirement is i have a source string as src{&q
View Tutorial          By: Anil at 2014-10-27 08:36:23