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
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!!!!
|
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...?
|