Forum: C Jun 14th, 2008 |
| Replies: 5 Views: 1,990 well that was one of my question. Why other elements of array are displayed correctly? So may be I'll try to figure it out.
May be here are hints for my answer. but If I had left it to chance... |
Forum: C Jun 14th, 2008 |
| Replies: 5 Views: 1,990 I allocated memory to a pointer, which i had to return. So I don't know where to free it as its a local variable. I was trying to create an array of variable length (user-specified). I got some help... |
Forum: C Jun 14th, 2008 |
| Replies: 5 Views: 831 Thanks doubt solved completely...
when I run the program as Mr. Salem said, I didn't free the memory, so a lot of thanks.
yeah I got a little overwhelmed but I don't want bad habits... |
Forum: C Jun 14th, 2008 |
| Replies: 5 Views: 831 >int *A = malloc ( size * sizeof *A );
yups that took the input from user and displayed the output correctly, but if I am right no array was created. Just an integer pointer.
So we have a way to... |
Forum: C Jun 14th, 2008 |
| Replies: 5 Views: 831 In C,how to define an array which is of a length specified by the user?
I tried writing a code, but outputs were strange. Sometimes first two elements are correctly displayed, sometimes only first.... |