关于指针的一个小问题
int *p;p=new int;
p=35;
这样是没问题,如果换成另外一种方法为什么就不行呢
typedef int *ptr;
ptr p;
p=new int;
p=35;
我吐血了,发错了地方.
顺便也看看吧
typedef int *ptr;
自定义类型 ptr==int *
#include<stdio.h>
typedef int* ptr;
int main()
{
int * p;
*p=35;
ptr q;
*q=35;
return 0;
}