| | |
؟questions?
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: May 2008
Posts: 10
Reputation:
Solved Threads: 0
hello again
i have three questions again:
how can i use malloc or calloc for a two demontional arrays?
is it true that A. calloc allocates memory in contiguous bytes, malloc does not ensure contiguous memory allocation?
the third question which is a bit irrelevent to programming
how memorey locations in computers are given address?i mean early intell CPUs could
onley address (64K) but what about the rest of memory locations?
thanks
i have three questions again:
how can i use malloc or calloc for a two demontional arrays?
is it true that A. calloc allocates memory in contiguous bytes, malloc does not ensure contiguous memory allocation?
the third question which is a bit irrelevent to programming
how memorey locations in computers are given address?i mean early intell CPUs could
onley address (64K) but what about the rest of memory locations?
thanks
> is it true that A. calloc allocates memory in contiguous bytes, malloc does not ensure contiguous memory allocation?
No, it's false.
calloc is nothing more than malloc + memset to wipe the memory to all-bits-zero.
> i mean early intell CPUs could onley address (64K)
Only 64K in a single block.
If you wanted more, then you had to start messing about with segment registers
http://en.wikipedia.org/wiki/X86
> how can i use malloc or calloc for a two demontional arrays?
One (of several) ways
No, it's false.
calloc is nothing more than malloc + memset to wipe the memory to all-bits-zero.
> i mean early intell CPUs could onley address (64K)
Only 64K in a single block.
If you wanted more, then you had to start messing about with segment registers
http://en.wikipedia.org/wiki/X86
> how can i use malloc or calloc for a two demontional arrays?
One (of several) ways
C Syntax (Toggle Plain Text)
char **arr = malloc( rows * sizeof *arr ); for ( r = 0 ; r < rows ; r++ ) { arr[r] = malloc( cols * sizeof *arr[r] ); }
![]() |
Similar Threads
- I have a few questions to be patched up can anybody get these to me ? (C++)
- Questions about Forum (Geeks' Lounge)
- Preparing for an interview and need some questions answered (C)
- Wireless Questions (Networking Hardware Configuration)
- Linux printing questions (*nix Hardware Configuration)
- Tutorials & Code Submissions - Questions? (DaniWeb Community Feedback)
Other Threads in the C Forum
- Previous Thread: octal to hexa with out format strings
- Next Thread: Complexity of sorting techniques
| Thread Tools | Search this Thread |
Tag cloud for C
#include adobe ansi array arrays asterisks binarysearch calculate centimeter changingto char convert copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic fflush file fork forloop framework getlasterror givemetehcodez grade graphics gtkgcurlcompiling hacking hardware histogram homework inches include incrementoperators input iso kernel km lazy linked linkedlist linux linuxsegmentationfault list lists locate logical_drives looping loopinsideloop. lowest match matrix microsoft motherboard multi mysql number opendocumentformat opensource owf pattern pdf performance pointer posix problem probleminc process program programming radix recursion recv research reversing scanf scripting segmentationfault sequential shape socket socketprograming spoonfeeding standard string strings structures student systemcall testing threads turboc unix user variable voidmain() wab windows.h windowsapi






