Home > Back-end >  Global variable sockaddr_in how to initialize an array type?
Global variable sockaddr_in how to initialize an array type?

Time:10-12

#include
#include

# define SOCKETMAX 128
Sockaddr_in siLocal [SOCKETMAX];

Compile error:
The error C2040: "siLocal" : "sockaddr_in [128]" and "sockaddr_in" indirect addressing different levels
The error C2088: "[" : illegal to struct

CodePudding user response:

Turned out to be a local variable to move to a global variable, and the other a global variable name clashes
Have to do is to rename the
  • Related