Solved

Memory allocation

Posted on 1998-09-21
6
210 Views
Last Modified: 2012-05-07
Hi,
   1)Whenever I used to allocate memory by declaring char *
and using faralloc , or malloc , etc , I will get a error
"Can't convert void * to char *" because as you know it is declared as void * malloc or faralloc in alloc.h.
  2) Please tell me how to develop a project in c (step by step). Because I tried to develop but when I used to build .prj file it give "Type name expected"
0
Comment
Question by:manjucee
  • 3
  • 3
6 Comments
 
LVL 10

Accepted Solution

by:
rbr earned 50 total points
ID: 1252948
You have to use a casting after malloc statement since malloc returns a void pointer

char *ptr;

prt=(char *)malloc (size);
0
 

Author Comment

by:manjucee
ID: 1252949
Hi rbr,
                   Thanks for giving me a solution , I dont know how i forgot this simple logic.
0
 

Author Comment

by:manjucee
ID: 1252950
Hi rbr,
           What about the second question that i have asked on creating a project in c.
Really I dont know how to do that one. I am facing lot of error message please guide me.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:rbr
ID: 1252951
Which compiler and OS to you use?
0
 
LVL 10

Expert Comment

by:rbr
ID: 1252952
What have you done already in your project and which errors do you get?
0
 

Author Comment

by:manjucee
ID: 1252953
Hi rbr,
                  It's Turbo C++ and OS is Windows NT 4.0
Here is the listing of .prj file
move  // driver program
menu(menu.h,keys.h)
ibm.obj
It is giving "Type name expected" for all i.e., move, menu(),ibm.obj
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question