473,394 Members | 1,739 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,394 software developers and data experts.

how to use malloc to allocate memory in c?

1
Hi,
Every body,
iam new to this website,
i want to know how to allocate memory using malloc in c?
if any body knows please post your answers ,i will be graceful to you people.
thanks & regards,
srinivas
Mar 24 '08 #1
2 1752
gpraghuram
1,275 Expert 1GB
Hi,
Every body,
iam new to this website,
i want to know how to allocate memory using malloc in c?
if any body knows please post your answers ,i will be graceful to you people.
thanks & regards,
srinivas

This is a very basic question in C.
Are you reading any C book?
Better start reading about this and then post your question

Raghuram
Mar 24 '08 #2
satch
23
Hi,
Every body,
iam new to this website,
i want to know how to allocate memory using malloc in c?
if any body knows please post your answers ,i will be graceful to you people.
thanks & regards,
srinivas
Online resources :
http://www.cplusplus.com/reference/clibrary/cstdlib/malloc.html
http://computer.howstuffworks.com/c29.htm
http://www.thescripts.com/forum/thread212982.html (A thread on 'theScripts' itself)
Mar 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: RS | last post by:
Hi, What is the difference between new() and malloc()? RS
8
by: lasek | last post by:
Hi...i'm writing from Rome...and i don't know english very well so... Only simple question, which is the difference between those two parts of code. int *pInt=NULL; int iVar=10; pInt=&iVar;
6
by: lovecreatesbeauty | last post by:
Hello experts, 1. Does C guarantee the data layout of the memory allocated by malloc function on the heap. I mean, for example, if I allocate a array of 100 elements of structure, can I always...
13
by: ppateel | last post by:
Hi, I am new to c++ and I am converting a c program to c++. I changed malloc call to new and I am getting an exception violation. Here is the relevant piece of code. Compiler vc++ 7.0 (.Net...
14
by: Roka100 | last post by:
Hi all, I tried 2 programs : #include <stdio.h> #include <string.h> 1, int main(void){ char *str = NULL;
49
by: Karsten Jung | last post by:
Hello together, We have to make our own implementation of malloc() under Linux. Does anybody can give me a hint where to start? Our implementation should only work under Linux. Thanks ...
9
by: Me | last post by:
Hi, I ran into a malloc problem but I can't find the solution. I try to read a file into a variable with malloc like this: BYTE *lcdata; lcdata = malloc(fsize*sizeof(BYTE));
71
by: desktop | last post by:
I have read in Bjarne Stroustrup that using malloc and free should be avoided in C++ because they deal with uninitialized memory and one should instead use new and delete. But why is that a...
14
by: karthikbalaguru | last post by:
Hi, In the case of heap , to keep track of a single chunk of memory it requires 8 bytes of information. That is, it requires 4 bytes to hold the size, and 4 bytes to hold the pointer to the next...
25
by: jbholman | last post by:
I am pretty new to C and doing my first project in C. I actually read almost the entire FAQ, but can't seem to figure out this problem. I have a structure. I have a list of these structures. ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.