473,382 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Dynamic Array Size

Hi to all,

Is there any way to define array size dynamically in C without using
malloc or calloc ?

Kind Regards

Manoj
Dec 4 '07 #1
6 1981
On Dec 4, 10:14 am, Manoj Jangid <systweakma...@gmail.comwrote:
Hi to all,

Is there any way to define array size dynamically in C without using
malloc or calloc ?
You can also use realloc(NULL, n); or a variable length array (C99
only)
Dec 4 '07 #2
Manoj Jangid wrote:
Hi to all,

Is there any way to define array size dynamically in C without using
malloc or calloc ?
realloc
Dec 4 '07 #3
On Dec 4, 1:14 pm, Manoj Jangid <systweakma...@gmail.comwrote:
Hi to all,

Is there any way to define array size dynamically in C without using
malloc or calloc ?

Kind Regards

Manoj
sorry I mean without using any memory allocation

Kind Regards

Manoj Jangid
Dec 4 '07 #4
Manoj Jangid wrote:
On Dec 4, 1:14 pm, Manoj Jangid <systweakma...@gmail.comwrote:
>Hi to all,

Is there any way to define array size dynamically in C without using
malloc or calloc ?

Kind Regards

Manoj

sorry I mean without using any memory allocation

Kind Regards
How can you "allocate" something without doing any "allocation"? What
are trying to do? If you can describe the actual problem you are trying
to solve, then it may be that it is possible to solve without jumping
through hoops.

Dec 4 '07 #5
On Dec 4, 4:14 pm, Manoj Jangid <systweakma...@gmail.comwrote:
Hi to all,

Is there any way to define array size dynamically in C without using
malloc or calloc ?

Kind Regards

Manoj
C99 variable length array
Dec 5 '07 #6
On Dec 5, 8:35 pm, "echo.sj" <sijie0...@gmail.comwrote:
On Dec 4, 4:14 pm, ManojJangid<systweakma...@gmail.comwrote:
Hi to all,
Is there any way to define array size dynamically in C without using
malloc or calloc ?
Kind Regards
Manoj

C99 variable length array
Thanks...
Dec 6 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nils | last post by:
Hi, I want to create a dynamic array with pointer, without allocation of the memory. I tried it so: objekt **ob= new objekt; It is not working, because he will parameter for the Konstructor...
11
by: D | last post by:
hi, i would like to know how to calculate the size of a dynamic array created using a dereference declaration like int *numbers and allocating via malloc or calloc: numbers=(int...
7
by: arkobose | last post by:
hey everyone! i have this little problem. consider the following declaration: char *array = {"wilson", "string of any size", "etc", "input"}; this is a common data structure used to store...
1
by: lemonade | last post by:
Hello! Can someone explain to me the difference between dynamic array of pointers vs dynamic array of objects by giving a real life example. Following is the code that I am using for dynamic...
1
by: Vijay Balki | last post by:
I have a array who's size I will know only at runtime. How do I initialize the size of the array at runtime? Is there a equivalent of ReDim in .NET?? VJ
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
19
by: arnuld | last post by:
/* C++ Primer - 4/e * chapter 4- Arrays & Pointers, exercise 4.28 * STATEMENT * write a programme to read the standard input and build a vector of integers from values that are read....
11
by: C C++ C++ | last post by:
Hi all, got this interview question please respond. How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Rgrds MA
13
by: kwikius | last post by:
Does anyone know what a C99 dynamic array is, and if it will be useable in C++? regards Andy Little
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.