• C

Memory allocation

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"
manjuceeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
rbrConnect With a Mentor Commented:
You have to use a casting after malloc statement since malloc returns a void pointer

char *ptr;

prt=(char *)malloc (size);
0
 
manjuceeAuthor Commented:
Hi rbr,
                   Thanks for giving me a solution , I dont know how i forgot this simple logic.
0
 
manjuceeAuthor Commented:
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
rbrCommented:
Which compiler and OS to you use?
0
 
rbrCommented:
What have you done already in your project and which errors do you get?
0
 
manjuceeAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.