concept of function() in 1st Chapter of C book
5 posters
Page 1 of 1
concept of function() in 1st Chapter of C book
I guess the title is self described.
but, while a fresher learns only printf() and scanf() function
how do they cope up with function calling?? :S
from my view point it is not right.
what about others? :S
I guess after conditional checking and for loop if it would be given then it would be more easier :S
but, while a fresher learns only printf() and scanf() function
how do they cope up with function calling?? :S
from my view point it is not right.
what about others? :S
I guess after conditional checking and for loop if it would be given then it would be more easier :S
BIT0115-Efat- Service Release
- Course(s) :
- BIT
Blood Group : O+
Posts : 779
Points : 1120
Re: concept of function() in 1st Chapter of C book
The way we learned it is the way it is taught everywhere.
printf and scanf are functions. But newbies do not know details about how they work, or even what is function when they start with it. After they learn how to use printf and scanf, they learn the for loop and conditional checking. Then, details about functions are taught.
lets take a look at Herbert Schildt's C
Functions are taught at the 7th chapter, where loops and control statements are taught beforehand.
Sometimes, it becomes necessary to learn through examples and practical approaches instead of direct theoretical approach. Through the practical approach, student's mind matures.
printf and scanf are functions. But newbies do not know details about how they work, or even what is function when they start with it. After they learn how to use printf and scanf, they learn the for loop and conditional checking. Then, details about functions are taught.
lets take a look at Herbert Schildt's C
Functions are taught at the 7th chapter, where loops and control statements are taught beforehand.
Sometimes, it becomes necessary to learn through examples and practical approaches instead of direct theoretical approach. Through the practical approach, student's mind matures.
Re: concept of function() in 1st Chapter of C book
If someone understand how does printf() or scanf() works, then why not general function? They are almost similar. The difference is that we dont know what has been done inside printf() or scanf() function to make it work but in our own function we know what are we doing and how.
Last edited by BIT0107-Toma on Mon Apr 04, 2011 12:57 am; edited 1 time in total (Reason for editing : extended the difference part)
BIT0107-Toma- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 280
Points : 453
Re: concept of function() in 1st Chapter of C book
BIT0122-Amit wrote:
lets take a look at Herbert Schildt's C
Functions are taught at the 7th chapter, where loops and control statements are taught beforehand.
but in the 1st chapter there is a little concept of it, and for sure teachers sometimes teach it before conditional checking :S
BIT0107-Toma wrote:If someone understand how does printf() or scanf() works, then why not general function? They are mostly similar.
in this stage we know much about
printf() or scanf() but what do we in the 1st semester??
what it returns, what is the parameter ! ! !
I guess these are naturally not taught
and if also it is taught I guess it will be much harder to them :S
and again don't think as a expert, think generally, as I am
I am not an expert in this case though.
BIT0115-Efat- Service Release
- Course(s) :
- BIT
Blood Group : O+
Posts : 779
Points : 1120
Re: concept of function() in 1st Chapter of C book
Hmm.. you are right I checked it from book.
in our 1st semester, we were taught about how to code, not how codes work inside at first, remember?
It is just like teaching language. First you learn how to speak, then you learn the in depth Details.
Introduction to functions, such as how functions are created, and what is return type, and what can we send as parameters should not be too difficult even for someone who does not know coding. I think two days at max will be required.
But once they get a firm grip of the basic, it becomes much easier to learn advanced things.
BTW, in my opinion, function calling is much easier to learn. If you want to teach conditional statements, you will also have to go through AND, OR, NOT, loops...
On the other hand, function calling only requires to learn what is parameter, what is return type, and how to call a function Of course, that's considering the basic.
in our 1st semester, we were taught about how to code, not how codes work inside at first, remember?
It is just like teaching language. First you learn how to speak, then you learn the in depth Details.
Introduction to functions, such as how functions are created, and what is return type, and what can we send as parameters should not be too difficult even for someone who does not know coding. I think two days at max will be required.
But once they get a firm grip of the basic, it becomes much easier to learn advanced things.
BTW, in my opinion, function calling is much easier to learn. If you want to teach conditional statements, you will also have to go through AND, OR, NOT, loops...
On the other hand, function calling only requires to learn what is parameter, what is return type, and how to call a function Of course, that's considering the basic.
Re: concept of function() in 1st Chapter of C book
Actually I agree quite a lot with Efat vai.
I can very well remember how Joarder sir taught us(BIT02) about function. It took days together to do so.
And even now,not most of us,who are amongst the regular C programmers, know the efficient use of function. And the rest are in bother about function calling,declaration and it's usage.
I also realized the functionality of functions perhaps towards the end of 2nd semester.
And finally,if I was a teacher,I would've definitely taught function ahead of loops,conditional checks and some other topics like pointer.
I don't think there would be any big problem in my way of doing so.
I can very well remember how Joarder sir taught us(BIT02) about function. It took days together to do so.
And even now,not most of us,who are amongst the regular C programmers, know the efficient use of function. And the rest are in bother about function calling,declaration and it's usage.
I also realized the functionality of functions perhaps towards the end of 2nd semester.
And finally,if I was a teacher,I would've definitely taught function ahead of loops,conditional checks and some other topics like pointer.
I don't think there would be any big problem in my way of doing so.
Re: concept of function() in 1st Chapter of C book
actually it is quiet difficult for us to teach a student.
and definitely those guys who are good programmers
because, while a fresher who suppose has no single idea about computer, where programming is much much far away.
the reason for the difficulty is we just think from our side, what we thought, it's tough for us to get the view point of the fresher.
however, things are going easy.
if anyone just make sure about the 1st chapter with variables and other basic with some knowledge about conditional checking + loop then the rest of the part is much easy
and definitely those guys who are good programmers
because, while a fresher who suppose has no single idea about computer, where programming is much much far away.
the reason for the difficulty is we just think from our side, what we thought, it's tough for us to get the view point of the fresher.
however, things are going easy.
if anyone just make sure about the 1st chapter with variables and other basic with some knowledge about conditional checking + loop then the rest of the part is much easy
BIT0115-Efat- Service Release
- Course(s) :
- BIT
Blood Group : O+
Posts : 779
Points : 1120
Re: concept of function() in 1st Chapter of C book
>.>
Pointers ahead of loops?
Pointer is probably the most difficult of all concepts in C.
And lets face it, you can't understand pointer without understanding variables and how they are stored in memory.
Pointers ahead of loops?
Pointer is probably the most difficult of all concepts in C.
And lets face it, you can't understand pointer without understanding variables and how they are stored in memory.
Re: concept of function() in 1st Chapter of C book
I said I would've taught function ahead of pointer. I didn't say pointer ahead of loopBIT0220-Iftekhar wrote:
And finally,if I was a teacher,I would've definitely taught function ahead of loops,conditional checks and some other topics like pointer.
Re: concept of function() in 1st Chapter of C book
Crap... :s I must've hit my head pretty hard that time :s :s Sorry for the unintentional mistake.
Re: concept of function() in 1st Chapter of C book
Depends on how you described these two functions to him.BIT0107-Toma wrote:If someone understand how does printf() or scanf() works, then why not general function?
BIT0107-Toma- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 280
Points : 453
Re: concept of function() in 1st Chapter of C book
BIT0107-Toma wrote:Depends on how you described these two functions to him.BIT0107-Toma wrote:If someone understand how does printf() or scanf() works, then why not general function?
yaap I know.
for this reason I told about how we think about it wither from our view point or their or from an expert's view point??
however, as I am not very much good in it, so I posted it, so that anyone can help me to make it more understandable and clear concept to the freshers.
BIT0115-Efat- Service Release
- Course(s) :
- BIT
Blood Group : O+
Posts : 779
Points : 1120
Re: concept of function() in 1st Chapter of C book
A function in C language is a block of code that performs a specific task. It has a name and it is reusable i.e. it can be executed from as many different parts in a C Program as required. It also optionally returns a value to the calling program
So function in a C program has some properties discussed below.
Every function has a unique name. This name is used to call function from “main()” function. A function can be called from within another function.
A function is independent and it can perform its task without intervention from or interfering with other parts of the program.
A function performs a specific task. A task is a distinct job that your program must perform as a part of its overall operation, such as adding two or more integer, sorting an array into numerical order, or calculating a cube root etc.
A function returns a value to the calling program. This is optional and depends upon the task your function is going to accomplish. Suppose you want to just show few lines through function then it is not necessary to return a value. But if you are calculating area of rectangle and wanted to use result somewhere in program then you have to send back (return) value to the calling function.
C language is collection of various inbuilt functions. If you have written a program in C then it is evident that you have used C’s inbuilt functions. Printf, scanf, clrscr etc. all are C’s inbuilt functions. You cannot imagine a C program without function.
So function in a C program has some properties discussed below.
Every function has a unique name. This name is used to call function from “main()” function. A function can be called from within another function.
A function is independent and it can perform its task without intervention from or interfering with other parts of the program.
A function performs a specific task. A task is a distinct job that your program must perform as a part of its overall operation, such as adding two or more integer, sorting an array into numerical order, or calculating a cube root etc.
A function returns a value to the calling program. This is optional and depends upon the task your function is going to accomplish. Suppose you want to just show few lines through function then it is not necessary to return a value. But if you are calculating area of rectangle and wanted to use result somewhere in program then you have to send back (return) value to the calling function.
C language is collection of various inbuilt functions. If you have written a program in C then it is evident that you have used C’s inbuilt functions. Printf, scanf, clrscr etc. all are C’s inbuilt functions. You cannot imagine a C program without function.
benjamin444- Pre-Alpha Release
- Course(s) :
- N/A
Blood Group : NULL
Posts : 3
Points : 3
Similar topics
» Slide of HR Management: chapter 9 and Link for Gery Desel's book
» Slides of Class 2 : Chapter 1 Sequence 2 & Chapter 1 Sequence 3
» chapter 5 solutions
» chapter 6 solutions
» chapter 2 and 3 solutions
» Slides of Class 2 : Chapter 1 Sequence 2 & Chapter 1 Sequence 3
» chapter 5 solutions
» chapter 6 solutions
» chapter 2 and 3 solutions
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Tue Sep 29, 2015 2:45 pm by Sophiawood
» Cisco EHWIC SFP/GE WAN Card
Mon Sep 07, 2015 11:08 am by Sophiawood
» Huawei S1700-28GFR-4P-AC Price
Thu Jun 25, 2015 2:31 pm by Sophiawood
» teach yourself C++ / Herbert Schildt Solutions
Wed Jun 03, 2015 1:52 pm by Abdullah Al Noman
» teach yourself c by herbert schildt pdf
Wed May 13, 2015 11:01 pm by Raquib Ridwan
» ASA 5506X With Firepower ASA5506-K9
Fri Apr 10, 2015 4:31 pm by Sophiawood
» New Trends in Deal Business
Tue Feb 03, 2015 9:38 pm by nersoa
» PoE Power Allocation for WS-C2960S-24PS-L
Wed Nov 05, 2014 11:12 am by Sophiawood
» How to cure back pain
Fri Oct 31, 2014 7:15 pm by Bergen Guildford