1樓:匿名使用者
字串是以\0結尾的,你刪除幾個字母之後,結尾的地方就要相應的重新置\0標記,也就是在printf之前,要寫str[j]='\0';
求c語言大神幫忙,解決一下這道題!
2樓:匿名使用者
include
main()
;//宣告結構變數和結構指標,並初始化
struct human x=,*p=&x;
//利用結構指標顯示結構中的資料
cout<<"(*p).name="<<(*p).name<符為p分配記憶體
p=new human;
//從鍵盤上為p指向的結構物件賦值
cout<<"p->name=";
cin>>p->name;
cout<<"p->***=";
cin>>p->***;
cout<<"p->age=";
cin>>p->age;
cout<<"-------------------------"
main()
;//宣告結構陣列和結構指標變數,並初始化
human x=,,},*p=null;
//用下標變數的輸出結構陣列的元素
for (int i=0;i<3;i++)
x;//使用結構變數x中的整型指標ip
x.ip=new int; //分配1個單元
*(x.ip)=100;
cout<<"x.ip:"<
main()
;//定義baby結構
struct baby ;
//宣告baby結構變數並初始化
baby b1=};
//下列是baby結構變數b1的引用。
cout<<"b1.num="<
main()
;//使用遞迴結構變數
list l1=;
cout<<"l1:"<
main()
;//用student宣告3個結構指標變數
struct student *head,*tail,*temp;
//申請第1塊資料,並設定各結構指標的初值
temp=new struct student; //申請記憶體
head=temp; // 頭指標
tail=head; // 尾指標
//迴圈為連結串列輸入資料
cout<<"\tname math ***puter"<>temp->name;
if (temp->name[0]!='*')
else
//為下一個學生申請記憶體
temp->next=new struct student;
temp=temp->next; // 使處理指標temp指向新記憶體塊
}//將連結串列資料從頭到尾列印出來
cout<<"--------------------"
cout<***puter<<","
3樓:
用匯編建一個資料庫
不過,我很懶
4樓:小乖00不乖
有要求用什麼寫麼,不知道做個mfc軟體行不行,行的話我這裡有一個你可以直接拿去用
c語言問題求大神指教,C語言問題求大神指教
應該是這樣才對 include void fun char a,char b 它等價於while b a 0 即複製餘下的串到b中 int main 這個程式是錯的吧,請問這個程式要做什麼事。第一個while的作用是跳過a指向的字串 也即字串 a b 中前面的 號,所以第一個while結束後a指向字...
c語言問題,求大神給解答,C語言問題,求大神給解答
type 35 bta p100 ds1191 pz38 type 35 bta p100 1 ds1191 1 pz38 1 type 35 2 press any key to continue include include include typedef struct node list,n...
C語言問題求大神
include int main printf d n e return 0 int a int b int i int j 0 dowhile a 10 a 0 printf 請輸入您要累加的次數 scanf d b for i 0 i b i printf d j include include...