Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

array contains zeros and ones as elements.we need to bring
zeros one side and one other side in single parse.
ex:a[]={0,0,1,0,1,1,0,0}
o/p={0,0,0,0,0,1,1,1}

Answer Posted / vignesh1988i

good morning sir,

in ur above program , u said u took then length as 8 and
then allocated ur memory using DMA... but ur way of
allocation find to be wrong sir.... as you allocated

int *ptr=(int*)malloc(sizeof(8));

the above statement will allocate only 2 bytes for u....
since you have given 8 inside sizeof operator.. this will
tell the compiler allocate 2 bytes of memory .. ur
instruction must be :

int *ptr=(int*)malloc(8*sizeof(int));

so, then it will allocate 8*2 bytes of memory sir.....

so only in my program i have given n*sizeof(int) , where
'n' can be any value that user gives........


thank u

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a class c rental property?

1084


What is meant by recursion?

1034


If you know then define #pragma?

1092


What is function prototype in c with example?

1061


Explain what is a stream?

1073


Why C language is a procedural language?

1008


What is the difference between struct and union in C?

1294


Explain the difference between the local variable and global variable in c?

1057


How can I read in an object file and jump to locations in it?

1016


What is %s and %d in c?

1024


Function calling procedures? and their differences? Why should one go for Call by Reference?

1075


How can you restore a redirected standard stream?

1107


What do you mean by c what are the main characteristics of c language?

1026


What are the back slash character constants or escape sequence charactersavailable in c?

1165


Do pointers store the address of value or the actual value of a variable?

1066