| |
|
Welcome to KnowledgeSutra - Dear Guest | |
Ponters In C
#1
Posted 23 October 2009 - 07:13 PM
So does any one know any simple and easy way to master pointers in C ?? please dont tell me the importance of pointers and such stuffs. I am sure everyone will be knowing the theoritical part behind pointers. when it comes to coding part it confuses people, So if you know some Big time methods to master pointers , just put it out ...
#2
Posted 23 October 2009 - 07:33 PM
Well until and unless you use pointers in any of your project be it small or large, you'll not understand the benefit of it. Why don't you try some project that uses pointers heavily. This will help you understand it's usage as well as when to use and when to avoid that. Let me point you to some resources that could help. Some good methods scattered in here.
1. Digital mars Pointers reference.
2. Poiters in C tutorial (pdf)
3. C book (Pointers chapter).
#5
Posted 23 October 2009 - 08:37 PM
Hi!
I know what you mean about people using Turbo C++ for learning C or C++. It has more to do with being able to find faculty to teach C and C++. Besides, with educators focusing more on the language itself than on the development environment, they don't really have specific guidelines about using Visual C++, Borland C++, GNU GCC/Cygwin, or some other software.
I think educators ought to demonstrate different software and enable the students to choose what they find the best. In a classroom of learners, there's quite a bit of exchange that gets learners sharing ideas and thoughts about the tools that they use for development. I remember a Java class I taught which had a mix of NetBeans, Eclipse, Borland JDeveloper, and others who used a text editor with a compiler.
Programming puzzles seem more appealing because they are short and give an idea of the different forms of C and C++ programs, some of which can be very cryptic. (Remember the obfuscated C code challenge?).
Pointers are not really hard to understand if you can put them in context. Distinguishing between arrays and pointers, rather than simply demonstrating an example that replaces arrays with pointers, is needed as a part of a chapter on pointers.
Here are some of the articles that I could find online about pointers:
GBDirect C Book: http://publications.gbdirect.co.uk/c_book/...5/pointers.html
Taranet Pointers: http://www.taranets.....pl?w=329;b=277
DuraMecho "Why C Has Pointers": http://duramecho.com...yCPointers.html
#6
Posted 28 October 2009 - 07:24 PM
On my view, the hard part the pointer is you need to consider when you have to dereference it
and how it will be when doing calculation such + and - based-on type you are working on.
I would suggest this is step for learning pointer.
1. pointer basis
2. single dimension pointer
3. do same projects using pure pointer as possible. i.e don't use array at all. Such as passing it to function etc.
4. multple dimension pointer such char **argv (i.e. pointer to pointer)
5. same as 3
6. working both at the same time as 3
7. try to use 3, or 4 level of pointer to pointer.
This is one of example that might be good for single dimension pointer.
Build a simple chat client-server char apps if you already knew how socket work.
It should be able issues command etc.
Also, I read these book for learning pointer.
C in a nutshell
prieme C plus
#7
Posted 14 February 2010 - 11:39 PM
#8
Posted 23 February 2010 - 12:17 PM
TheProblem:
QuiteOften in programming, we have to read and write to files. The type ofFile is determined by the extension on it. For example, files withExtension ‘.Txt’ are text files, ‘.Doc’ are word files,‘.Xls’ are excel files.
YouAre required to write a C program that will be able to sieveDifferent types of numbers and write them in appropriate files. WeShall use three files file_even which is a word document, file_oddWhich is a text document and file_prime which is an excel file.
UsingThe integers from 1 to 500,
Write all even files with their halves in file_even. Every even number should be on its own line and a number is separated from its half with a tab.
Write all odd numbers with their squares in file_odd. Every odd number should be on its own line and it is separated from its square with a tab
Write all prime numbers and their thirds (rounded to 2 decimal places) in file_prime. Every prime number should be on its own line and a prime number and its third should be in separate cells (equivalent of tabs)
-reply by Norman Aine
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users















