472,805 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 1721
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. ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.