How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! (1243 Views)
| How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 1:10pm On Dec 03, 2019 |
Please i have been trying to allocate a memory space for a ragged array (arrays of pointers of type char). but it happens that the two functions are not working. I used the assert function to know if the calloc() worked and it worked. My program do compile but when i enter a long string the program either terminates or jump to another memory location of the row index.
|
| Re: How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 1:19pm On Dec 03, 2019 |
Have you included stdlib library. |
| Re: How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 1:27pm On Dec 03, 2019 |
Ausrichie:yes. |
| Re: How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 1:45pm On Dec 03, 2019 |
BlaqTesla:Ahn what error did you get. And secondly check stdlib header if the function prototype was declared there had a problem with gets() sometime ago realised that gets() was obsolete. |
| Re: How To Allocate Space For Ragged Array Using Calloc() Or Malloc? HELP! by Nobody: 2:00pm On Dec 03, 2019 |
Ausrichie:I have solved the problem already. Thanks |
Write An Algorithm To Shuffle An Array • How To Sort Array In Java With User Defined Method ? • How To Empty An Array In Javascript • 2 • 3 • 4
Kodearena 2006 • Embedded Development Is Yet To Be Appreciated In Nigeria • Project Topic