Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language, int p, * p = 10 Why is it wrong?
C language, int p, * p = 10 Why is it wrong?
Hello, I'm glad to answer your question.

You may have some misunderstandings about variable types in C language. There are two mistakes in your program statement: first, according to speculation, you mean to define variables and then assign values to them. Then this should be two statements with a semicolon in the middle; Second, your int p means that p is an integer variable, which means that p can only store integer data. Then there is no such representation as * p.

I don't know what you want to express, so I'll show you two correct expressions for your reference.

The first type: int p;; p = 10; Or int p =10;

The second type: int * p;; * p = 10;

I hope I can help you. If there is anything wrong, please criticize and correct me.