Questions tagged [array]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
738 views

declaring char array vs malloc

I was watching the week 5 lecture and David said that a chunk of memory can be allocated two ways: using malloc(); declaring an array of a certain size (char buffer[10]). Is there really any ...
0
votes
2answers
126 views

Pset3 Resize Array not storing data properly

I'm not sure where the issue is here, but from the looks of debug I only store anything in my horizontal array (line) once despite seeing the debugger hitting that section of code properly. I assume I ...
1
vote
1answer
139 views

not fully understanding dynamically sized array in server.c pest

I am not fully understanding what is happening in the line below Char line[needle - haystack + 2 + 1] Is it subtracting the address of needle from haystack(haystack and needle are pointers) then ...
0
votes
1answer
247 views

check50 claiming pairs are sorted incorrectly

On Problem Set 3, check50 has flagged my program as not having sorted the pairs correctly. However, the pairs array appears to be sorted in every case I've tried. I used insertion sort and had ...
0
votes
2answers
22k views

How to create an array/subarray by extracting a part of another array?

Does anyone know how one can create a subarray by extracting a part of an existing array. Is there something like subarray[] =existingArray[0-3]? I need this to compare the first 4 bytes of my block ...
0
votes
2answers
438 views

different between pointers and pointer to arrays?

difference between -- char a[SIZE]; //Char array of size (SIZE) char *a; //character pointer. Points towards a char (a). char *a[SIZE]; // Array of pointer characters. char *(a[SIZE]); // Pointer ...