Uses_conversion is used to convert the type. For example, we have the following common problems:
During socket programming, the cstring type is generally used for entering IP addresses from the interface. However, inet_addr in sockaddr_in is a const char * and we cannot use cstring directly. We can use the T2A () Macro.
Sockaddr_in localaddr;
Cstring m_ip = l "192.168.1.2 ";
Uses_conversion;
Localaddr. sin_family = af_inet;
Localaddr. sin_addr.s_un.s_addr = inet_addr (T2A (m_ip ));
Of course, the use of uses_conversion is also a very important issue.
Uses_conversion: it allocates space on the stack, which means that you will not be released before the function ends. Do not use a while loop in a function to execute it, otherwise the stack space will be allocated immediately (the stack space is generally only 2 m, very small ).
Usage and attention of uses_conversion