int *a = NULL; int *b = "a"; a = b;
时间: 2024-05-29 10:12:12 浏览: 123
This code will not compile because we are trying to assign a string literal (which is a constant array of characters) to a pointer to an integer. The types are incompatible, and the compiler will generate an error. Additionally, even if we change the type of `b` to `int*`, we cannot dereference `b` because it points to a null address. This would result in undefined behavior.
阅读全文