Hello,
I'm working on trying to translate some assembly code into C. I think I correctly interpreted lines 1-3. Could someone explain what lines 4-6 are doing?
Take line 4, for example. To...
Type: Posts; User: c_seeker
Hello,
I'm working on trying to translate some assembly code into C. I think I correctly interpreted lines 1-3. Could someone explain what lines 4-6 are doing?
Take line 4, for example. To...
Thanks !
Hello,
I was wondering if these two ways of writing things are always the same in terms of their truth value and what the compiler thinks:
assert(myStruct->field != NULL);...
Hello,
Suppose I dynamically create memory for an array in an external function. When using free later, I'm not sure if I should just use free once on the entire array object, or if I am supposed...
Thanks tabstop!
This compiled o.k.:
int main(void){
char *a;
a = (char*) malloc (100*sizeof(char));
Hello,
This compiles o.k.:
int main(void){
char *a;
a = (char*) malloc (100*sizeof(char));
Thank you so much for this clarification. It's very strange this C stuff! Here is my new code:
size_t i_want_this_much = 1000;
int *a = malloc(i_want_this_much * sizeof(*a));
...
Thanks for your suggestion. However, so I know I am properly allocating memory, I want the computer to tell me the size by actually checking the size, not just recalling a pre-set variable. It's...
Hello,
I'm trying to keep track of the size of blocks of memory that a pointer points to. No matter what I do, this code below always outputs the integer 8.
If I change 1000 to 5, I still...