Error: invalid conversion from 'int' to 'int*' [-fpermissive] while initialising pointer address

Advertisements I’m trying to assign the value of 0x0010 to pointer ptr1 in the following code that demonstrates how pointers interact with addition/subtraction: #include <stdio.h> int main(void) { int * ptr1=0x0010; double * ptr2=0x0010; printf("%p %p\n", ptr1+1, ptr1+2); // Increment by 4 then 8 printf("%p %p\n", ptr2+1, ptr2+2); // Increment by 8 then 16 printf("%p… Read More Error: invalid conversion from 'int' to 'int*' [-fpermissive] while initialising pointer address

How to send 2d-array as argument to function that expects 1d-array in C?

Advertisements This is an exercise from the book C Programming: A modern approach by K.N King "Assume that the following array contains a week’s worth of hourly temperature readings, with each row containing the readings for one day: int temperatures[7][24]; Write a statement that uses the search function to search the entire temperatures array for… Read More How to send 2d-array as argument to function that expects 1d-array in C?