IITDU Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

concept of function() in 1st Chapter of C book

5 posters

Go down

C concept of function() in 1st Chapter of C book

Post by BIT0115-Efat Mon Apr 04, 2011 12:40 am

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
BIT0115-Efat
BIT0115-Efat
Service Release
Service Release

Course(s) :
  • BIT

Blood Group : O+
Posts : 779
Points : 1120

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0122-Amit Mon Apr 04, 2011 12:45 am

Neutral 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.
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0107-Toma Mon Apr 04, 2011 12:48 am

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
BIT0107-Toma
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 280
Points : 453

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0115-Efat Mon Apr 04, 2011 12:59 am

BIT0122-Amit wrote:Neutral
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 Razz
I am not an expert in this case though.
BIT0115-Efat
BIT0115-Efat
Service Release
Service Release

Course(s) :
  • BIT

Blood Group : O+
Posts : 779
Points : 1120

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0122-Amit Mon Apr 04, 2011 1:20 am

Hmm.. you are right Very Happy I checked it from book.

in our 1st semester, we were taught about how to code, not how codes work inside at first, remember? Razz

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 Very Happy Of course, that's considering the basic.
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0220-Iftekhar Mon Apr 04, 2011 2:49 am

Actually I agree quite a lot with Efat vai. Smile
I can very well remember how Joarder sir taught us(BIT02) about function. It took days together to do so. Neutral
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. Very Happy
And finally,if I was a teacher,I would've definitely taught function ahead of loops,conditional checks and some other topics like pointer. Wink
I don't think there would be any big problem in my way of doing so.
BIT0220-Iftekhar
BIT0220-Iftekhar
Administrator-RC

Course(s) :
  • BIT

Blood Group : B+
Posts : 434
Points : 630

http://iftekharunplugged.blogspot.com

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0115-Efat Mon Apr 04, 2011 3:12 am

actually it is quiet difficult for us to teach a student.
and definitely those guys who are good programmers Razz
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 Smile
BIT0115-Efat
BIT0115-Efat
Service Release
Service Release

Course(s) :
  • BIT

Blood Group : O+
Posts : 779
Points : 1120

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0122-Amit Mon Apr 04, 2011 3:43 am

>.>

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.
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0220-Iftekhar Mon Apr 04, 2011 4:18 am

BIT0220-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. Wink
I said I would've taught function ahead of pointer. I didn't say pointer ahead of loop Neutral
BIT0220-Iftekhar
BIT0220-Iftekhar
Administrator-RC

Course(s) :
  • BIT

Blood Group : B+
Posts : 434
Points : 630

http://iftekharunplugged.blogspot.com

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0122-Amit Mon Apr 04, 2011 4:20 am

Crap... :s I must've hit my head pretty hard that time :s :s Sorry for the unintentional mistake.
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0107-Toma Mon Apr 04, 2011 4:55 am

BIT0107-Toma wrote:If someone understand how does printf() or scanf() works, then why not general function?
Depends on how you described these two functions to him.
BIT0107-Toma
BIT0107-Toma
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 280
Points : 453

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by BIT0115-Efat Mon Apr 04, 2011 5:09 am

BIT0107-Toma wrote:
BIT0107-Toma wrote:If someone understand how does printf() or scanf() works, then why not general function?
Depends on how you described these two functions to him.

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
BIT0115-Efat
Service Release
Service Release

Course(s) :
  • BIT

Blood Group : O+
Posts : 779
Points : 1120

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by benjamin444 Fri Aug 05, 2011 5:19 pm

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.

benjamin444
Pre-Alpha Release
Pre-Alpha Release

Course(s) :
  • N/A

Blood Group : NULL
Posts : 3
Points : 3

Back to top Go down

C Re: concept of function() in 1st Chapter of C book

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum