Initialization makes pointer from integer without a cast - C

前端 未结 4 2196
执笔经年
执笔经年 2021-02-08 09:10

Sorry if this post comes off as ignorant, but I\'m still very new to C, so I don\'t have a great understanding of it. Right now I\'m trying to figure out pointers.

I mad

4条回答
  •  别跟我提以往
    2021-02-08 09:23

    Maybe you wanted to do this:

    #include 
    
    int change( int *b )
    {
      *b = 4;
      return 0;
    }
    
    int main( void )
    {
      int *b;
      int myint = 6;
    
      b = &myint;
      change( &b );
      printf( "%d", b );
      return 0;
    }
    

提交回复
热议问题