When i try that i get an error message at the pointer=malloc(2*sizeof(int));
which says invalid conversion from void to int .. whats going wrong there?
WendellHarper - Dec 06 2020 01:21 PM
WendellHarper - Dec 06 2020 01:14 PM
pindo - Jul 23 2020 01:33 AM
Siten0308 - Jun 20 2019 01:43 PM
johnnylo - Apr 23 2019 07:49 AM
Posted 09 June 2014 - 06:25 AM
When i try that i get an error message at the pointer=malloc(2*sizeof(int));
which says invalid conversion from void to int .. whats going wrong there?
Posted 09 June 2014 - 08:34 AM
int *pointer = (int *) malloc(2*sizeof(int));
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid
Posted 09 June 2014 - 10:02 AM
oh ok it works now ! thanks a lot!
Posted 11 May 2015 - 10:06 PM
Good their are so many replies but all are in positve manner....As all are know malloc() and realloc() are used in dynamic resource locator..
Posted 07 January 2017 - 01:01 PM
Posted 24 March 2017 - 07:25 PM
t assign memory to an array. An array has a fixed size, for the whole of its ... Is there any difference between using malloc(n*sizeof(int)) and calloc(n,sizeof(int)) ?
Language Forums →
C# →
Counting the integers frequences in an array entered by the userStarted by AndreMarques, 27 Nov 2017 ![]() |
|
![]() |
||
Language Forums →
PHP →
How Come Variable Not Assigned And Php Knows Where To Look For Value ?Started by uniqueideaman, 06 May 2017 ![]() |
|
![]() |
||
Language Forums →
C and C++ →
help me . c++. ArraysStarted by girl2383, 06 Feb 2017 ![]() |
|
![]() |
||
Language Forums →
C and C++ →
Selecting an element on a 2D arrayStarted by LonelyGuySylar, 18 May 2016 ![]() |
|
![]() |
||
Language Forums →
Java →
Include a specific error, task, problem, or question in your titleStarted by rjb7, 15 Apr 2016 ![]() |
|
![]() |