Back | Reverse | Quick Reply | Post Reply |

TC programming Language...HELP!!!!
Link | by wings_of_angel on 2006-12-13 17:37:31
OK our professor ask us to have a project about,

1.) The Malloc Function
2.) Pointers used in Array
3.) Pointers used in a String

PLease guyz help, i need atleast 20 programs and what they do, moreover i need to display the output. T_T WAAAAAAAAA!!!!!!!!! I would appreciate it if you post sample programs about these categories, and please state what it is, and whta it does, please..... My grades are at stake. T_T

Re: TC programming Language...HELP!!!!
Link | by gendou on 2006-12-13 18:29:44
are you asking for program ideas or already made programs? i don't understand.


Re: TC programming Language...HELP!!!!
Link | by EmptyMind on 2006-12-13 18:54:07
Mmmm...

malloc takes a size in bytes and allocates it in memory. It returns a pointer to the allocated space.

A pointer in an array points the first element in an array. When you use an index with an array, you are getting the value of the memory in the array. When you use the array without an index, it's the pointer.
For example, when you pass an array to another function, you are passing the pointer to the array, not a copy of the array as with non array data.

A string and a char array are the same thing in C, although a string should be null terminated. the string "apple" would be represented by:
string[0]='a'
string[1]='p'
string[2]='p'
string[3]='l'
string[4]='e'
string[5]='\0' or the null char
The variable string would be a pointer to string[0]

So... you want 20 programs...?

>,>; Did I just say that...?

Back | Reverse | Quick Reply | Post Reply |

Copyright 2000-2024 Gendou | Terms of Use | Page loaded in 0.0024 seconds at 2024-04-27 06:28:28