博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
指针与数组在结构体中的应用(问题)。
阅读量:2140 次
发布时间:2019-04-30

本文共 317 字,大约阅读时间需要 1 分钟。

#if 1

#include <stdio.h>
#include <string.h>
struct student     //
{
char   *name ;   //if array,it is avaliable. //MEMORY IS NOT HAVE A SKY.若改为数组就好了。
int score;
}stu,*pstu;
int main()
{
//union student stu;    
strcpy(stu.name,"Jimy");
stu.score = 99;
printf("string is %s  ",stu.name);
return 0;
}

error  : 内存没有分配空间给指针变量,初始化内容为空.

 

转载地址:http://vdtgf.baihongyu.com/

你可能感兴趣的文章
【LEETCODE】215-Kth Largest Element in an Array
查看>>
【LEETCODE】241-Different Ways to Add Parentheses
查看>>
【LEETCODE】312-Burst Balloons
查看>>
【LEETCODE】232-Implement Queue using Stacks
查看>>
【LEETCODE】225-Implement Stack using Queues
查看>>
【LEETCODE】155-Min Stack
查看>>
【LEETCODE】20-Valid Parentheses
查看>>
【LEETCODE】290-Word Pattern
查看>>
【LEETCODE】36-Valid Sudoku
查看>>
【LEETCODE】205-Isomorphic Strings
查看>>
【LEETCODE】204-Count Primes
查看>>
【LEETCODE】228-Summary Ranges
查看>>
【LEETCODE】27-Remove Element
查看>>
【LEETCODE】66-Plus One
查看>>
【LEETCODE】26-Remove Duplicates from Sorted Array
查看>>
【LEETCODE】118-Pascal's Triangle
查看>>
【LEETCODE】119-Pascal's Triangle II
查看>>
【LEETCODE】88-Merge Sorted Array
查看>>
【LEETCODE】19-Remove Nth Node From End of List
查看>>
【LEETCODE】125-Valid Palindrome
查看>>