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

unable to allocate memory in middle of file

I created a structure containing two variables of type char.

i.e.
Expand|Select|Wrap|Line Numbers
  1. char name[64],char details[128];
And a pointer to structure now when I write this name and details to file and now I want to change the particular name.

i.e.

To modify then if the stored file name is greater than the entered name then it is erasing the next record line also I need to allocate some memory.
Jan 24 '13 #1
2 1501
Banfa
9,065 Expert Mod 8TB
If we are going to help you discern the problem it would be helpful to see the code you already have that writes to and reads from the file.
Jan 24 '13 #2
weaknessforcats
9,208 Expert Mod 8TB
Also, the answer is different if you are using C++ instead of C.
Feb 10 '13 #3

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

Similar topics

37
by: Curt | last post by:
If this is the complete program (ie, the address of the const is never taken, only its value used) is it likely the compiler will allocate ram for constantA or constantB? Or simply substitute the...
4
by: alan | last post by:
Dear all, I am a newbie in C++. If I want to allocate memory to objects, I will use double *d = new double instead of ANSI-C malloc. But if I want to resize, say enlarge num of objects to...
4
by: Franklin Lee | last post by:
Hi All, I use new to allocate some memory,even I doesn't use delete to release them. When my Application exit, OS will release them. Am I right? If I'm right, how about Thread especally on...
4
by: marora | last post by:
I have created class definition which contains a charater pointer as one of it's data memeber. The objective is to read some data from a file, and assign it to a data member; Size of data is...
1
by: rveloso | last post by:
Hi all, i'm having a really nasty problem with popen. I have the following code : --------------------- .... FILE *PD; .... sprintf(fname,"/usr/bin/gzip -dc %s/%s",dirname,dp->d_name); .......
11
by: Divick | last post by:
Hi, can somebody help me figure out how can I make write a function which inturn uses malloc routine to allocate memory which is 2^k aligned? The condition is such that there should not be any...
14
by: raghu | last post by:
Hello , This is Raghu. I have a problem in declaring a structure. Consider struct hai{ int id; char sex; int age; }; here when a variable is instianted for this structure then immediately
5
by: raghu | last post by:
Hello , This is Raghu. I have a problem in declaring a structure. Consider struct hai{ int id; char sex; int age; }; here when a variable is instianted for this structure then immediately
0
by: Varav | last post by:
We have a simple web service for DB2 to consume. I have tested the SOAPHTTPV and it is pretty slick. It is great that a database can do this. I first tested single requests over and over by...
1
by: darkdai | last post by:
hey everyone im trying to write a code that will have different functions which will allocate memory, de-allocate, reallocate etc. this is my code #include<stdio.h> #include<stdlib.h> void main()...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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,...

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.