Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How does C++ assign a string variable to an integer variable
How does C++ assign a string variable to an integer variable
//You can use the memcpy function to assign values.

///# contains "stdafx.h"

# include & ltstdio.h & gt

# include & ltiostream & gtint main(int argc,char* argv[])

{

char a[]= " aa ";

int b;

memcpy(& amp; b,a,4);

STD::cout & lt; & ltb; //The output is 24929

}