Computing.Net > Forums > Programming > turbo c

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

turbo c

Reply to Message Icon

Name: _swish
Date: November 13, 2003 at 23:55:53 Pacific
OS: win2000
CPU/Ram: 128
Comment:

im trying to write a program about pointers and arrays...
it should accept ten numbers with the use of pointers/arrays then it will arrrange the numbers from smallest to largest...
then it will display the sum and product of all the ten numbers...
please help me!...
i've been working in this problem for 2 weeks now...
i'm very confused in using pointers...



Sponsored Link
Ads by Google

Response Number 1
Name: Avdhesh
Date: November 14, 2003 at 01:05:11 Pacific
Reply:

Hi,
This is a simple problem. Please refer Schaum series C programming by Byron S. Gottfried. After reading Pointers from this book, I think you will never face problems in C pointers. This book is published by Tata Mcgraw Hill in India and in abroad by McGraw hill. But the ultimate book in C Pointers is -" Pointers in C" by Yashwant Kanetkar ( BPB Publication , New Delhi, India).
Try it but you face further problem in this program, mail me at avdhesh_k_s@yahoo.co.in .

In C array is def as -
int x[10];
to access 5th element you have to do x[4]. Using pointers the same can be done as :
int *x;
this is int pointer decleration.
To occupy space of 10 elements do-
x = (int *) malloc( 10 * sizeof(int));
never forget to include malloc.h.
now you can use *(x+4) to get 5th element.


0
Reply to Message Icon

Related Posts

See More


help me in c Credit Card Validation



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: turbo c

turbo c++ ver 3.0 www.computing.net/answers/programming/turbo-c-ver-30/15436.html

turbo C borland www.computing.net/answers/programming/turbo-c-borland/5408.html

where can I downl. turbo c 3.0 or best www.computing.net/answers/programming/where-can-i-downl-turbo-c-30-or-best-/418.html