2024年4月28日发(作者:)

C++ 程序源码

#include

int fun(char *a, char *h, char *p)

{

int i, j;

/*删除指针h与p之间的所有“*”*/

for(i=0,j=0; &h[i]

if(h[i]!='*')

h[j++]=h[i];

/*将指针p至字符串尾部的所有字符前移*/

for(i=0; p[i]; i++,j++)

h[j]=p[i];

h[j]='0';

/*在字符串尾部添加结束标志*/

return 0;

}

int main( )

{

char s[81], *t, *f;

printf("Enter a string :n");

gets(s); /*输入字符串*/

t=f=s; /*用字符指针t、f指向串s*/

while(*t)

t++;

t--;

/*将指针t定位到字符串中最后一个字符*/

while(*t == '*')

/*指针t指向字符串中最后一个字符*/

t--;

while (*f == '*')

/*指针f指向字符串中第一个字符*/

f++;

fun(s, f, t);

printf("The string after deleted:n");

/*输出结果*/

puts(s);

return 0;

}

C++ Source Part One

#if !defined(AFX_GispDLOGIN_GispH_Gisp_GispCA968D8E_GispEBBD_Gisp4BB2_Gisp965

A_GispF7867C1234FE_Gisp_GispINCLUDED_Gisp)

#define

AFX_GispDLOGIN_GispH_Gisp_GispCA968D8E_GispEBBD_Gisp4BB2_Gisp965A_GispF78

67C1234FE_Gisp_GispINCLUDED_Gisp

#if _GispMSC_GispVER > 1000

#pragma once

#endif _GispMSC_GispVER > 1000

DLogin.h : header file

#include "RxStatic.h"

CDLogin dialog

#include "BaseEdit.h"

class CDLogin : public CDialog

{

Construction

public:

CDLogin(CWnd pParent = NULL); standard constructor

Dialog Data

{{AFX_GispDATA(CDLogin)

enum { IDD = IDD_GispLOGIN };

CBaseEdit m_GispEdtPwd;

CBaseEdit m_GispEdtName;

RxStatic m_GispStaTitle;

HICON m_GisphIcon;

}}AFX_GispDATA

Overrides

ClassWizard generated virtual function overrides

{{AFX_GispVIRTUAL(CDLogin)

public:

virtual int DoModal();

protected:

virtual void DoDataExchange(CDataExchange pDX); DDXDDV support

}}AFX_GispVIRTUAL

Implementation

protected:

Generated message map functions

{{AFX_GispMSG(CDLogin)

virtual void OnOK();

virtual BOOL OnInitDialog();

afx_Gispmsg void OnButlogin();

afx_Gispmsg void OnButexit();

}}AFX_GispMSG

DECLARE_GispMESSAGE_GispMAP()

private:

int m_GispnTryTime;

};

{{AFX_GispINSERT_GispLOCATION}}

Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif !defined(AFX_GispDLOGIN_GispH_Gisp_GispCA968D8E_GispEBBD_Gisp4BB2_Gi