কোডিং এর শুরুতে আমি int arr[100] নিলাম পরে এর সাইজ কিভাবে বাড়াব ডায়নামিকেলি?

asked 15 Mar '16, 14:51

Rashedul60's gravatar image

Rashedul60
3916


better use pointers and dynamic memory allocation...

int *arr;             //declare a pointer
int size_of_array;
scanf("%d",&size_of_array);
arr=(int*)malloc(sizeof(int)*size_of_array);       //memory allocation
permanent link

answered 15 Mar '16, 16:39

omar_faruk's gravatar image

omar_faruk
613

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×402

question asked: 15 Mar '16, 14:51

question was seen: 627 times

last updated: 15 Mar '16, 16:39