Hi:
I am reading this book called "Teach yourself C". This book was published in 1990 and author's name is Osborn.
He expalines the examples somehow very vague and difficult to understant. There must be a simple way to explain an example.
1. This program prints 123 on the screen.
/*This program has three fuctions.*/
#include <stdio.h>
main()
{
func2();
printf("3");
}
func2()
{
func1();
printf("2");
}
func1()
{
printf("1");
}
the explanation for this program accoring to author:
In this program, main() first calls fuc2(),
which then calls func1(). Next, func1() displays 1 and returns to fuc2(), which prints 2 and then returns to func2(), which prints2 and then returns to main(), which prints3.
I am sorry , you senior programmers, might think how stupid I am.
But the fact is, I am new to C and if this program had one function
I do understand it, I think, this program will give the same result if it had only one function. After main (), it should be: {
int num; num=123 then printf ("the value is %d", num");
}
but he has jump from one func to another and created a confusion. Is it OK, to read a C book that is 12 years old?
Thank you



LinkBack URL
About LinkBacks


