C源码(107)

C源码(107)
C源码(107)

#if !defined(AFX_GUDPAGE1_H__8675A73D_2544_49A1_9DA7_2ADC4CDB8D30__INCLU DED_)

#define

AFX_GUDPAGE1_H__8675A73D_2544_49A1_9DA7_2ADC4CDB8D30__INCLUDED_

#include "RxGrid.h"

#include "RxRecordset.h" Added by ClassView

#if _MSC_VER > 1000

#pragma once

#endif _MSC_VER > 1000

DPage1.h : header file

CDGYPage1 dialog

class CDGYPage1 : public CDialog

{

Construction

public:

void SetRecordset(RxRecordset Rrst);

CDGYPage1(CWnd pParent = NULL); standard constructor

Dialog Data

{{AFX_GUDA TA(CDGYPage1)

enum { IDD = IDD_PAGE1 };

RxGrid m_X_GuGrid;

}}AFX_GUDA TA

Overrides

ClassWizard generated virtual function overrides

{{AFX_GUVIRTUAL(CDGYPage1)

protected:

virtual void DoDataExchange(CDataExchange pDX); DDXDDV support

}}AFX_GUVIRTUAL

Implementation

protected:

Generated message map functions

{{AFX_GUMSG(CDGYPage1)

virtual BOOL OnInitDialog();

}}AFX_GUMSG

DECLARE_MESSAGE_MAP()

private:

RxRecordset rst;

};

{{AFX_GUINSERT_LOCATION}}

Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif !defined(AFX_GUDPAGE1_H__8675A73D_2544_49A1_9DA7_2ADC4CDB8D30__I NCLUDED_)

Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++ NOTE: Do not modify the contents of this file. If this class is regenerated by Microsoft Visual C++, your modifications will be overwritten.

#include "stdafx.h"

#include "vcvaluescale.h"

CVcV alueScale properties

CVcV alueScale operations

BOOL CVcValueScale::GetAuto()

{

BOOL result;

InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_BOOL, (void)&result, NULL);

return result;

}

void CVcValueScale::SetAuto(BOOL bNewValue)

{

static BYTE parms[] =

VTS_BOOL;

InvokeHelper(0x1, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, bNewValue);

}

double CVcValueScale::GetMinimum()

{

double result;

InvokeHelper(0x2, DISPATCH_PROPERTYGET, VT_R8, (void)&result, NULL);

return result;

}

void CVcValueScale::SetMinimum(double newValue)

{

static BYTE parms[] =

VTS_R8;

InvokeHelper(0x2, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms, newValue);

}

double CVcValueScale::GetMaximum()

{

double result;

InvokeHelper(0x3, DISPATCH_PROPERTYGET, VT_R8, (void)&result, NULL);

return result;

}

void CVcValueScale::SetMaximum(double newValue)

{

static BYTE parms[] =

VTS_R8;

InvokeHelper(0x3, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,

newValue);

}

short CVcValueScale::GetMajorDivision()

{

short result;

InvokeHelper(0x4, DISPATCH_PROPERTYGET, VT_I2, (void)&result, NULL);

return result;

}

void CVcValueScale::SetMajorDivision(short nNewValue)

{

static BYTE parms[] =

VTS_I2;

InvokeHelper(0x4, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,

nNewValue);

}

short CVcValueScale::GetMinorDivision()

{

short result;

InvokeHelper(0x5, DISPATCH_PROPERTYGET, VT_I2, (void)&result, NULL);

return result;

}

void CVcValueScale::SetMinorDivision(short nNewV alue)

{

static BYTE parms[] =

VTS_I2;

InvokeHelper(0x5, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,

nNewValue);

}

C源码Part Three

#if !defined(AFX_GUDPASS_H__DA15A9C4_6732_4176_B6CB_F6584EE1C1B6__INCLUDE D_)

#define AFX_GUDPASS_H__DA15A9C4_6732_4176_B6CB_F6584EE1C1B6__INCLUDED_ #if _MSC_VER > 1000

#pragma once

#endif _MSC_VER > 1000

DPass.h : header file

#include "BaseAFX_GuComboBox.h"

#include "BaseAFX_GuButton.h"

#include "BaseAFX_GuDateTimeCtrl.h"

#include "BaseAFX_GuEdit.h"

CDPass dialog

class CDPass : public CDialog

{

Construction

public:

void Save();

bool m_X_GubInsertOrUpdate;

void Display();

void Clear();

void Enabled(bool bEnabled);

CDPass(CWnd pParent = NULL); standard constructor Dialog Data

{{AFX_GUDA TA(CDPass)

enum { IDD = IDD_PASS };

CBaseAFX_GuEdit m_X_GuEdtTGBH;

CBaseAFX_GuButton m_X_GuRadYES;

CBaseAFX_GuButton m_X_GuRadNO;

CBaseAFX_GuButton m_X_GuRadALL;

CBaseAFX_GuEdit m_X_GuEdtTDYY;

CBaseAFX_GuEdit m_X_GuEdtLRRBM;

CBaseAFX_GuEdit m_X_GuEdtLRR;

CBaseAFX_GuEdit m_X_GuEdtJGS;

CBaseAFX_GuEdit m_X_GuEdtJE;

CBaseAFX_GuEdit m_X_GuEdtHL;

CBaseAFX_GuEdit m_X_GuEdtHBJ;

CBaseAFX_GuEdit m_X_GuEdtGS;

CBaseAFX_GuEdit m_X_GuEdtFKFS;

CBaseAFX_GuEdit m_X_GuEdtCYDJMC;

CBaseAFX_GuEdit m_X_GuEdtBZJ;

CBaseAFX_GuEdit m_X_GuEdtBZ;

CBaseAFX_GuEdit m_X_GuEdtBH;

CBaseAFX_GuEdit m_X_GuEdtBGYWBH;

CBaseAFX_GuEdit m_X_GuEdtBGSJ;

BaseAFX_GuDateTimeCtrl m_X_GuDtZZSJ;

BaseAFX_GuDateTimeCtrl m_X_GuDtXCSBSJ;

BaseAFX_GuDateTimeCtrl m_X_GuDtXCFXSJ;

BaseAFX_GuDateTimeCtrl m_X_GuDtTDSJ;

BaseAFX_GuDateTimeCtrl m_X_GuDtQSSJ;

BaseAFX_GuDateTimeCtrl m_X_GuDtLRSJ;

CBaseAFX_GuComboBox m_X_GuComID;

CBaseAFX_GuButton m_X_GuChkXCFXBZ;

CBaseAFX_GuButton m_X_GuChkTDBZ;

CBaseAFX_GuButton m_X_GuChkSFJSTG;

CBaseAFX_GuButton m_X_GuChkEDIFSBZ;

CButton m_X_GuButTotal;

CButton m_X_GuButSave;

CButton m_X_GuButInto;

}}AFX_GUDA TA

Overrides

ClassWizard generated virtual function overrides

{{AFX_GUVIRTUAL(CDPass)

protected:

virtual void DoDataExchange(CDataExchange pDX); DDXDDV support

}}AFX_GUVIRTUAL

Implementation

protected:

Generated message map functions

{{AFX_GUMSG(CDPass)

virtual void OnOK();

virtual void OnCancel();

AFX_Gumsg void OnSetfocusComid();

AFX_Gumsg void OnButinto();

AFX_Gumsg void OnButsave();

virtual BOOL OnInitDialog();

AFX_Gumsg void OnButtotal();

}}AFX_GUMSG

DECLARE_MESSAGE_MAP()

};

{{AFX_GUINSERT_LOCATION}}

Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif !defined(AFX_GUDPASS_H__DA15A9C4_6732_4176_B6CB_F6584EE1C1B6__INC LUDED_)

C源码Part Four

DialogUsers.cpp : implementation file

#include "stdafx.h"

#include "a1.h"

#include "DialogUsers.h"

#include "myfunction.h"

#include "Crypt.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

CDialogUsers dialog

CDialogUsers::CDialogUsers(CWnd pParent =NULL)

: CDialog(CDialogUsers::IDD, pParent)

{

{{AFX_GUDA TA_INIT(CDialogUsers)

NOTE: the ClassWizard will add member initialization here }}AFX_GUDA TA_INIT

}

void CDialogUsers::DoDataExchange(CDataExchange pDX)

{

CDialog::DoDataExchange(pDX);

{{AFX_GUDA TA_MAP(CDialogUsers)

DDX_Control(pDX, IDC_EDIT3, m_X_GueditMM2);

DDX_Control(pDX, IDC_EDIT2, m_X_GueditMM1);

DDX_Control(pDX, IDC_EDIT1, m_X_GueditName);

DDX_Control(pDX, IDC_COMBO1, m_X_GucomboPurview);

}}AFX_GUDA TA_MAP

}

BEGIN_MESSAGE_MAP(CDialogUsers, CDialog)

{{AFX_GUMSG_MAP(CDialogUsers)

}}AFX_GUMSG_MAP

END_MESSAGE_MAP()

CDialogUsers message handlers

BOOL CDialogUsers::OnInitDialog()

{

CDialog::OnInitDialog();

LRunSql m_X_Gurunsql;

CString sql;

_variant_t value;

int i=0;

sql.Format("select from tabpurview");

if(!m_X_Gurunsql.CheckSQLResult(sql))

{

this->EndDialog(0);

return false;

}

while(!m_X_Gurunsql.m_X_Gurecordset->adoEOF)

{

value=m_X_Gurecordset->GetCollect("admi_purview");

this->m_X_GucomboPureview.InsertString(i,(char)(_bstr_t)value);

m_X_Gurunsql.m_X_Gurecordset->MoveNext();

i++;

}

this->m_X_GucomboPurview.InsertString(0,"超级用户");

this->m_X_GucomboPurview.InsertString(1,"管理员");

this->m_X_GucomboPurview.InsertString(2,"标准用户");

this->m_X_GucomboPurview.InsertString(3,"一般用户");

this->m_X_GucomboPurview.SetCurSel(3);

return TRUE; return TRUE unless you set the focus to a control

EXCEPTION: OCX Property Pages should return FALSE }

void CDialogUsers::OnOK()

{

HWND hwnd=this->GetFocus()->GetSafeHwnd();

if(hwnd==this->m_X_GueditName.GetSafeHwnd())

{

this->m_X_GueditMM1.SetFocus();

return;

}

else if(hwnd==this->m_X_GueditMM1.GetSafeHwnd())

{

this->m_X_GueditMM2.SetFocus();

return;

}

else if(hwnd==this->m_X_GueditMM2.GetSafeHwnd())

{

this->m_X_GucomboPurview.SetFocus();

return;

}

CString m_X_GusNewPW1,m_X_GusNewPW2;

this->m_X_GueditMM1.GetWindowText(m_X_GusNewPW1);

this->m_X_GueditMM2.GetWindowText(m_X_GusNewPW2);

LRunSql m_X_Gurunsql;

CString sql;

CString name;

int purview=m_X_GucomboPurview.GetCurSel();

this->m_X_GueditName.GetWindowText(name);

if(name=="")

{

MessageBox("用户名不可为空");

m_X_GueditName.SetFocus();

return;

}

if(m_X_GusNewPW1!=m_X_GusNewPW2)

{

MessageBox("请确认密码相同");

m_X_GueditMM2.SetFocus();

return;

}

else

{

try{

sql.Format("select from tabpurview where admi_name = '%s'"

,name);

if(m_X_Gurunsql.CheckSQLResult(sql))

{

MessageBox("请换一个用户名,该用户名已被注册");

return;

}

CString s_password=CCrypt::Encrypt(m_X_GusNewPW2);

sql.Format("insert into tabpurview(admi_name,admi_password,admi_purview) values('%s','%s',%d)"

,name,s_password,purview);

m_X_Gurunsql.RunSQL(sql);

}

catch(_com_X_Guerror& e)

{

AfxMessageBox(e.ErrorMessage());

return ;

}

MessageBox("成功添加新用户!","医药管理系统");

this->m_X_GustrName=name;

this->m_X_GucomboPurview.GetWindowText(m_X_GustrPurview);

}

CDialog::OnOK();

}

C源码Part One

#if !defined(AFX_GUDLGTHECK_H__182E7DA5_8864_413D_85E4_BB03E6FF2E9E__INC LUDED_)

#define

AFX_GUDLGTHECK_H__182E7DA5_8864_413D_85E4_BB03E6FF2E9E__INCLUDED_

#if _MSC_VER > 1000

#pragma once

#endif _MSC_VER > 1000

DlgTheCK.h : header file

CDlgTheCK dialog

class CDlgTheCK : public CDialog

{

Construction

public:

CDlgTheCK(CWnd pParent = NULL); standard constructor

Dialog Data

{{AFX_GUDA TA(CDlgTheCK)

enum { IDD = IDD_DIALOG_CK };

CEdit m_X_GueditName;

CComboBox m_X_GucomboYg;

}}AFX_GUDA TA

bool m_X_GubAdd;

CString m_X_GustrCkName;

CString m_X_GustrCkAdmi;

Overrides

ClassWizard generated virtual function overrides

{{AFX_GUVIRTUAL(CDlgTheCK)

protected:

virtual void DoDataExchange(CDataExchange pDX); DDXDDV support

}}AFX_GUVIRTUAL

Implementation

protected:

Generated message map functions

{{AFX_GUMSG(CDlgTheCK)

virtual BOOL OnInitDialog();

virtual void OnOK();

}}AFX_GUMSG

DECLARE_MESSAGE_MAP()

};

{{AFX_GUINSERT_LOCATION}}

Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif !defined(AFX_GUDLGTHECK_H__182E7DA5_8864_413D_85E4_BB03E6FF2E9E__ INCLUDED_)

C源码Part Two

WordGLXT.cpp : Defines the class behaviors for the application.

#include "stdafx.h"

#include "WordGLXT.h"

#include "WordGLXTDlg.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

CWordGLXTApp

BEGIN_MESSAGE_MAP(CWordGLXTApp, CWinApp)

{{AFX_GUMSG_MAP(CWordGLXTApp)

NOTE - the ClassWizard will add and remove mapping macros here.

DO NOT EDIT what you see in these blocks of generated code!

}}AFX_GUMSG

ON_COMMAND(ID_HELP, CWinApp::OnHelp)

END_MESSAGE_MAP()

CWordGLXTApp construction

CWordGLXTApp::CWordGLXTApp()

{

TODO: add construction code here,

Place all significant initialization in InitInstance

}

The one and only CWordGLXTApp object

CWordGLXTApp theApp;

CUsers user;

CWordGLXTApp initialization

BOOL CWordGLXTApp::InitInstance()

{

AfxEnableControlContainer();

Standard initialization

If you are not using these features and wish to reduce the size

of your final executable, you should remove from the following

the specific initialization routines you do not need.

#ifdef _AFXDLL

Enable3dControls(); Call this when using MFC in a shared DLL #else

Enable3dControlsStatic(); Call this when linking to MFC statically

#endif

AfxInitRichEdit();

CWordGLXTDlg dlg;

m_X_GupMainWnd = &dlg;

int nResponse = dlg.DoModal();

if (nResponse == IDOK)

{

TODO: Place code here to handle when the dialog is

dismissed with OK

}

else if (nResponse == IDCANCEL)

{

TODO: Place code here to handle when the dialog is

dismissed with Cancel

}

Since the dialog has been closed, return FALSE so that we exit the

application, rather than start the application's message pump.

return FALSE;

}

C源码Part Three

DlgTheCK.cpp : implementation file

#include "stdafx.h"

#include "a1.h"

#include "DlgTheCK.h"

#include "myfunction.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

CDlgTheCK dialog

CDlgTheCK::CDlgTheCK(CWnd pParent =NULL)

: CDialog(CDlgTheCK::IDD, pParent)

{

{{AFX_GUDA TA_INIT(CDlgTheCK)

NOTE: the ClassWizard will add member initialization here }}AFX_GUDA TA_INIT

}

void CDlgTheCK::DoDataExchange(CDataExchange pDX)

{

CDialog::DoDataExchange(pDX);

{{AFX_GUDA TA_MAP(CDlgTheCK)

DDX_Control(pDX, IDC_EDIT1, m_X_GueditName);

DDX_Control(pDX, IDC_COMBO1, m_X_GucomboYg);

}}AFX_GUDA TA_MAP

}

BEGIN_MESSAGE_MAP(CDlgTheCK, CDialog)

{{AFX_GUMSG_MAP(CDlgTheCK)

}}AFX_GUMSG_MAP

END_MESSAGE_MAP()

CDlgTheCK message handlers

BOOL CDlgTheCK::OnInitDialog()

{

CDialog::OnInitDialog();

LRunSql m_X_Gurunsql;

CString str;

CString sql;_variant_t value;

sql.Format("select yg_id,yg_name from tabyginfo");

if(m_X_Gurunsql.CheckSQLResult(sql))

while(!m_X_Gurunsql.m_X_Gurecordset->adoEOF)

{

value=m_X_Gurunsql.m_X_Gurecordset->GetCollect("yg_id");

if(value.vt!=VT_NULL)

str=(char)(_bstr_t)value;

str+=":";

value=m_X_Gurunsql.m_X_Gurecordset->GetCollect("yg_name");

if(value.vt!=VT_NULL)

str+=(char)(_bstr_t)value;

this->m_X_GucomboYg.AddString(str);

m_X_Gurunsql.m_X_Gurecordset->MoveNext();

}

m_X_GucomboYg.SetCurSel(0);

if(m_X_GubAdd)

this->SetWindowText("添加新仓库");

else

{

this->SetWindowText("修改仓库");

this->m_X_GueditName.SetWindowText(m_X_GustrCkName);

this->m_X_GueditName.SetReadOnly();

int mark=-1;

if((mark=m_X_GucomboYg.FindString(-1,m_X_GustrCkAdmi))>=0) m_X_GucomboYg.SetCurSel(mark);

}

return TRUE; return TRUE unless you set the focus to a control

EXCEPTION: OCX Property Pages should return FALSE }

void CDlgTheCK::OnOK()

{

HWND hwnd=this->GetFocus()->GetSafeHwnd();

if(hwnd==this->m_X_GueditName.GetSafeHwnd())

{

this->m_X_GucomboYg.SetFocus();

return;

}

this->m_X_GucomboYg.GetWindowText(m_X_GustrCkAdmi);

CString yg_id=m_X_GustrCkAdmi.Left(m_X_GustrCkAdmi.Find(':'));

this->m_X_GueditName.GetWindowText(this->m_X_GustrCkName);

if(m_X_GustrCkName=="")

{

MessageBox("仓库名称不能为空");

m_X_GueditName.SetFocus();

return;

}

LRunSql m_X_Gurunsql;

CString sql;

if(m_X_GubAdd)

{

sql.Format("select from tabck where ck_name='%s'",this->m_X_GustrCkName);

if(m_X_Gurunsql.CheckSQLResult(sql))

{

MessageBox("该仓库已有,请换个仓库名称","注意");

return;

}

sql.Format("insert into tabck(ck_name,yg_id) values('%s','%s')",

m_X_GustrCkName,yg_id);m_X_GustrCkAdmi

m_X_Gurunsql.RunSQL(sql);

_variant_t value;CStringList slist;

sql.Format("select from tabypinfo");

m_X_Gurunsql.CheckSQLResult(sql);

while(!m_X_Gurunsql.m_X_Gurecordset->adoEOF)

{

value=m_X_Gurunsql.m_X_Gurecordset->GetCollect("yp_id");

slist.AddTail((char)(_bstr_t)value);

m_X_Gurunsql.m_X_Gurecordset->MoveNext();

}

POSITION pos=NULL;

for(pos=slist.GetHeadPosition();pos!=NULL;)

{

sql.Format("insert into tabkc(yp_id,ck_name,kc_number,alert_leverup,alert_leverdown) \

values('%s','%s',0,100000,10)",slist.GetNext(pos),m_X_GustrCkName);

m_X_Gurunsql.RunSQL(sql);

}

}

else

{

sql.Format("update tabck set yg_id='%s' where ck_name = '%s'",yg_id,m_X_GustrCkName);

m_X_Gurunsql.RunSQL(sql);

}

CDialog::OnOK();

}

C源码Part Four

Rizhib.cpp: implementation of the CRizhib class.

#include "stdafx.h"

#include "WordGLXT.h"

#include "Rizhib.h"

#ifdef _DEBUG

#undef THIS_FILE

static char THIS_FILE[]=__FILE__;

#define new DEBUG_NEW

#endif

ConstructionDestruction

CRizhib::CRizhib()

{

}

CRizhib::~CRizhib()

{

}

CString CRizhib::GetName()

{

return Name;

}

void CRizhib::SetName(CString cName)

{

Name=cName;

}

CString CRizhib::GetDLsj()

{

return DLsj;

}

void CRizhib::SetDLsj(CString cDLsj)

{

DLsj=cDLsj;

}

CString CRizhib::GetDZ()

{

return DZ;

}

void CRizhib::SetDZ(CString cDZ)

{

DZ=cDZ;

}

void CRizhib::sql_insert()

{

ADOConn m_X_GuAdoConn;

_bstr_t vSQL;

vSQL="insert into Rizhib(Name,DLsj,DZ)values('"+Name+"','"+DLsj+"','"+DZ+"')";

m_X_GuAdoConn.ExecuteSQL(vSQL);

m_X_GuAdoConn.ExitConnect();

}

C源码Part Five

#if !defined(AFX_GUVCLABELS_H__BC287B91_5455_419E_A016_2D120540CB9D__INCL

UDED_)

#define

AFX_GUVCLABELS_H__BC287B91_5455_419E_A016_2D120540CB9D__INCLUDED_

#if _MSC_VER > 1000

#pragma once

#endif _MSC_VER > 1000

Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

NOTE: Do not modify the contents of this file. If this class is regenerated by

Microsoft Visual C++, your modifications will be overwritten.

Dispatch interfaces referenced by this interface

class CVcLabel;

CVcLabels wrapper class

class CVcLabels : public COleDispatchDriver

{

public:

CVcLabels() {} Calls COleDispatchDriver default constructor

CVcLabels(LPDISPA TCH pDispatch) : COleDispatchDriver(pDispatch) {}

CVcLabels(const CVcLabels& dispatchSrc) : COleDispatchDriver(dispatchSrc) {} Attributes

public:

Operations

public:

long GetCount();

CVcLabel GetItem(short LabelIndex);

};

{{AFX_GUINSERT_LOCATION}}

Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif !defined(AFX_GUVCLABELS_H__BC287B91_5455_419E_A016_2D120540CB9D__I NCLUDED_)

Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

NOTE: Do not modify the contents of this file. If this class is regenerated by

Microsoft Visual C++, your modifications will be overwritten.

#include "stdafx.h"

#include "columns.h"

Dispatch interfaces referenced by this interface

#include "Column.h"

CColumns properties

CColumns operations

long CColumns::GetCount()

{

long result;

InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_I4, (void)&result, NULL);

return result;

}

CColumn CColumns::Add(short Index)

{

LPDISPATCH pDispatch;

static BYTE parms[] =

VTS_I2;

InvokeHelper(0x2, DISPATCH_METHOD, VT_DISPA TCH, (void)&pDispatch, parms, Index);

return CColumn(pDispatch);

}

CColumn CColumns::GetItem(const V ARIANT& Index)

{

LPDISPATCH pDispatch;

static BYTE parms[] =

VTS_V ARIANT;

InvokeHelper(0x0, DISPA TCH_PROPERTYGET, VT_DISPATCH, (void)&pDispatch, parms,

&Index);

return CColumn(pDispatch);

}

void CColumns::Remove(const V ARIANT& Index)

{

static BYTE parms[] =

VTS_V ARIANT;

InvokeHelper(0x3, DISPATCH_METHOD, VT_EMPTY, NULL, parms,

&Index);

}

C语言函数大全(m开头)

C语言函数大全(m开头) main()主函数 每一C 程序都必须有一 main() 函数, 可以根据自己的爱好把它放在程序的某 个地方。有些程序员把它放在最前面, 而另一些程序员把它放在最后面, 无论放 在哪个地方, 以下几点说明都是适合的。 1. main() 参数 在Turbo C2.0启动过程中, 传递main()函数三个参数: argc, argv和env。 * argc: 整数, 为传给main()的命令行参数个数。 * argv: 字符串数组。 在DOS 3.X 版本中, argv[0] 为程序运行的全路径名; 对DOS 3.0 以下的版本, argv[0]为空串("") 。 argv[1] 为在DOS命令行中执行程序名后的第一个字符串; argv[2] 为执行程序名后的第二个字符串; ... argv[argc]为NULL。 *env: 安符串数组。env[] 的每一个元素都包含ENVVAR=value形式的字符 串。其中ENVVAR为环境变量如PATH或87。value 为ENVVAR的对应值如C:\DOS, C: \TURBOC(对于PATH) 或YES(对于87)。 Turbo C2.0启动时总是把这三个参数传递给main()函数, 可以在用户程序中 说明(或不说明)它们, 如果说明了部分(或全部)参数, 它们就成为main()子程序 的局部变量。 请注意: 一旦想说明这些参数, 则必须按argc, argv, env 的顺序, 如以下 的例子: main() main(int argc) main(int argc, char *argv[]) main(int argc, char *argv[], char *env[])

C++工资管理系统源代码

C++工资管理系统源代 码 Document number【AA80KGB-AA98YT-AAT8CB-2A6UT-A18GG】

#define TITLE "\n 月份工号姓名应发工资各种折扣实发工资\n" #define DATA " %2d %4ld %-10s % % %\n",p1->month,p1- >num,p1->name,p1->should_pay,p1->rebate,p1->actual_pay typedef struct pay { long num; short month; char name[20]; float gw,jn,zw,zl,jt,yj; float should_pay; float fz,gj,sd,others; float rebate; float actual_pay; struct pay *next; }PAY;

FILE *fp; PAY *p1=NULL,*p2=NULL,*head=NULL; void menu(); PAY *input(); void output(); void save(PAY *head); PAY *open(); PAY *insert(); void search(); PAY *del(); PAY *revise(); /*主程序模块*/ void main(void) { short sel; do

{ menu(); scanf("%d",&sel); switch(sel) { case 1: head=input(); 建工资档案\n"); printf("\t\t\t\t2.新增工资信息\n"); printf("\t\t\t\t3.修改工资信息\n"); printf("\t\t\t\t4.删除工资信息\n"); printf("\t\t\t\t5.查找工资信息\n"); printf("\t\t\t\t6.分类信息列表\n"); printf("\t\t\t\t7.保存信息\n"); printf("\t\t\t\t0.退出\n"); printf("\n\n\n\n\n\n\n\n"); }

C语言标准库函数2012

常用C语言标准库函数2012 C语言编译系统提供了众多的预定义库函数和宏。用户在编写程序时,可以直接调用这些库函数和宏。这里选择了初学者常用的一些库函数,简单介绍了各函数的用法和所在的头文件。 1.测试函数 Isalnum 原型:int isalnum(int c) 功能:测试参数c是否为字母或数字:是则返回非零;否则返回零 头文件:ctype.h Isapha 原型:int isapha(int c) 功能:测试参数c是否为字母:是则返回非零;否则返回零 头文件:ctype.h Isascii 原型:int isascii(int c) 功能:测试参数c是否为ASCII码(0x00~0x7F):是则返回非零;否则返回零 头文件:ctype.h Iscntrl 原型:int iscntrl(int c) 功能:测试参数c是否为控制字符(0x00~0x1F、0x7F):是则返回非零;否则返回零 头文件:ctype.h Isdigit 原型:int isdigit(int c) 功能:测试参数c是否为数字:是则返回非零;否则返回零。 头文件:ctype.h Isgraph 原型:int isgraph(int c) 功能:测试参数c是否为可打印字符(0x21~0x7E):是则返回非零;否则返回零头文件:ctype.h Islower 原型:int islower(int c) 功能:测试参数c是否为小写字母:是则返回非零;否则返回零 头文件:ctype.h

Isprint 原型:int isprint(int c) 功能:测试参数c是否为可打印字符(含空格符0x20~0x7E):是则返回非零;否则返回零 头文件:ctype.h Ispunct 原型:int ispunct(int c) 功能:测试参数c是否为标点符号:是则返回非零;否则返回零 头文件:ctype.h Isupper 原型:int isupper(inr c) 功能:测试参数c是否为大写字母:是则返回非零;否则返回零 Isxdigit 原型:int isxdigit(int c) 功能:测试参数c是否为十六进制数:是则返回非零;否则返回零 2.数学函数 abs 原型:int abs(int i) 功能:返回整数型参数i的绝对值 头文件:stdlib.h,math.h acos 原型:double acos(double x) 功能:返回双精度参数x的反余弦三角函数值 头文件:math.h asin 原型:double asin(double x) 功能:返回双精度参数x的反正弦三角函数值 头文件:math.h atan 原型:double atan(double x) 功能:返回双精度参数的反正切三角函数值 头文件:math.h atan2 原型:double atan2(double y,double x) 功能:返回双精度参数y和x由式y/x所计算的反正切三角函数值 头文件:math.h cabs

C语言函数库详解(收藏版)

c语言函数库 目录 第一章(C标准库) (4) 1. :诊断 (4) 2. :字符类别测试 (5) 3. :错误处理 (5) 4. :整型常量 (6) 5. :地域环境 (6) 6. :数学函数 (7) 7. :非局部跳转 (8) 8. :信号 (9) 9. :可变参数表 (11) 10. :公共定义 (11) 11. :输入输出 (12) 12. :实用函数 (13) 13. :日期与时间函数 (13) 第二章(IO函数) (14) clearerr:复位错误标志函数 (15) feof:检测文件结束符函数 (16) ferror:检测流上的错误函数 (17) fflush:清除文件缓冲区函数 (18) fgetc:从流中读取字符函数 (19) fgetpos:取得当前文件的句柄函数 (20) fgets:从流中读取字符串函数 (21) fopen、fclose:文件的打开与关闭函数 (22) fprintf:格式化输出函数 (23) fputc:向流中输出字符函数 (25) fputs:向流中输出字符串函数 (25) fread:从流中读取字符串函数 (26) freopen:替换文件中数据流函数 (27) fscanf:格式化输入函数 (28) fseek:文件指针定位函数 (28) fsetpos:定位流上的文件指针函数 (30) ftell:返回当前文件指针位置函数 (31) fwrite:向文件写入数据函数 (31) getc:从流中读取字符函数 (32) getchar:从标准输入文件中读取字符函数 (33) gets:从标准输入文件中读取字符串函数 (34) perror:打印系统错误信息函数 (34) printf:产生格式化输出的函数 (35) putc:向指定流中输出字符函数 (36) putchar:向标准输出文件上输出字符 (37)

C语言常用函数手册

1.分类函数,所在函数库为ctype.h int isalpha(int ch) 若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0 int isalnum(int ch) 若ch是字母('A'-'Z','a'-'z')或数字('0'-'9'),返回非0值,否则返回0 int isascii(int ch) 若ch是字符(ASCII码中的0-127)返回非0值,否则返回0 int iscntrl(int ch) 若ch是作废字符(0x7F)或普通控制字符(0x00-0x1F) 返回非0值,否则返回0 int isdigit(int ch) 若ch是数字('0'-'9')返回非0值,否则返回0 int isgraph(int ch) 若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0 int islower(int ch) 若ch是小写字母('a'-'z')返回非0值,否则返回0 int isprint(int ch) 若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0 int ispunct(int ch) 若ch是标点字符(0x00-0x1F)返回非0值,否则返回0 int isspace(int ch) 若ch是空格(' '),水平制表符('\t'),回车符('\r'), 走纸换行('\f'),垂直制表符('\v'),换行符('\n') 返回非0值,否则返回0 int isupper(int ch) 若ch是大写字母('A'-'Z')返回非0值,否则返回0 int isxdigit(int ch) 若ch是16进制数('0'-'9','A'-'F','a'-'f')返回非0值, 否则返回0 int tolower(int ch) 若ch是大写字母('A'-'Z')返回相应的小写字母('a'-'z') int toupper(int ch) 若ch是小写字母('a'-'z')返回相应的大写字母('A'-'Z') 2.数学函数,所在函数库为math.h、stdlib.h、string.h、float.h int abs(int i) 返回整型参数i的绝对值 double cabs(struct complex znum) 返回复数znum的绝对值 double fabs(double x) 返回双精度参数x的绝对值 long labs(long n) 返回长整型参数n的绝对值 double exp(double x) 返回指数函数ex的值 double frexp(double value,int *eptr) 返回value=x*2n中x的值,n存贮在eptr中double ldexp(double value,int exp); 返回value*2exp的值 double log(double x) 返回logex的值 double log10(double x) 返回log10x的值 double pow(double x,double y) 返回xy的值 double pow10(int p) 返回10p的值 double sqrt(double x) 返回+√x的值 double acos(double x) 返回x的反余弦cos-1(x)值,x为弧度 double asin(double x) 返回x的反正弦sin-1(x)值,x为弧度 double atan(double x) 返回x的反正切tan-1(x)值,x为弧度 double atan2(double y,double x) 返回y/x的反正切tan-1(x)值,y的x为弧度double cos(double x) 返回x的余弦cos(x)值,x为弧度 double sin(double x) 返回x的正弦sin(x)值,x为弧度 double tan(double x) 返回x的正切tan(x)值,x为弧度 double cosh(double x) 返回x的双曲余弦cosh(x)值,x为弧度 double sinh(double x) 返回x的双曲正弦sinh(x)值,x为弧度

员工工资管理系统源代码样本

#include #include typedef struct { int basic;//基本工资 int position;//岗位工资 int subsidy;//津贴 int wages;//奖金 int sum;//总工资 }money; typedef struct { char num[20];//职工号 char name[20];//姓名 int age;//年龄 char sex[20];//性别 money salary;//工资 }employee; int Print_jinru();//账号密码输入 void Fscan_information();//”职工信息.txt”文件写入

void Print_staff();//全体员工 void Print_empl1(char x[51]);//按职工号查询 void Print_empl2(char s[51]);//按姓名查询 void Print_MainInterface();//主界面 void Print_Interface_1();//职工信息录入界面 void Print_Interface_2();//职工信息查询界面 void Print_Interface_3();//职工工资排序界面 void Print_Interface_4();//职工总工资 void Print_Interface_5();//文件读出 void qsort(int l,int r);//快速排序 void Print_delete(int t);//删除职工信息 void Print_Interface_2_1(int t);//职工信息修改界面 int fyanzheng(char s1[],char s2[]);//密码验证函数employee st[500];//记录职工信息的函数 int n;//职工总数 void main() { int x; employee em; printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@\n");

C语言函数大全

C语言函数大全 1 字符测试函数 函数(及意义)函数分解Isalnum(){判断字符是否is alphbet(字母表) number(数字) 为字母或数字} Isalpha(){判断是否为英文is alphbet(字母表) 字母} Isblank(){空格和TAB} is blank(空格) Iscntrl() { 控制} is control(控制) Isdigit(){数字} is digit(数字) Isgraph(){除空格外的可打is graph(图表) 印字符} Islower(){是否为小写} is lowercase(小写) Isprintf(){可打印字符含空这个简单 字符} Ispunct(){标点或特殊符号is punctuation(标点) } Isspace(){检查是否为空字is space(空间) 符,即判断是否为空格,水平 定位字符“\t”,归位字符“\r ”,垂直定位字符“\v”,换行 字符“\n”,翻页“\f”} Isupper(){是否为大写字母is upper_case(大写) } Isxdigit(){十六进制} is hexadecimal digit(十六进制) Tolower(){将小写转换成 大写} Toupper(){将大写转换成这个简单(to change 或者to covert 或者 小写} transformation

字符串函数 Memchr(){在某一内存范围内查找一特定字符}Memory (储存)char(字符型炭)也可以是character (字符) Memcmp(){比较区域 str1,str2的前n个字节} Memory(同理)compare(比较) Memcpy(){由str2所指内存区域复 制n个字节到str1所指内存区域} Memory copy(复制) Memmove(){两个所指的内存区域 可重叠,但是内容会更改,函数 返回值为指向区域内存的指针} Memory move(移动) Memset(){把str所指的内存区域 的前N个字节设置成字符c} Set(设置)

C员工工资管理系统源代码

C员工工资管理系统源代码

#include #include #include #include #include #include using namespace std; #define NULL 0 #define LEN sizeof(struct student) int const N=20; void Menu(); void Pass(); int n=0; //定义一个全局变量统计职工人数//——--------->定义一个职工信息的结构体 struct student { char name[N]; //用来存放姓名 char sex[N]; //用来存放性别 long id; //用来存放编号 float paid[3]; //用来存放工资 int total; //用来存放总工资 struct student *next;

}; //-------------->职工类 class Information { public: Information() ; //构造函数. ~Information() ; //析构函数. student *creat(); //建立链表 void output(student *head); //显示职工信息 int count(student *head); //定义函数count()统计职工总数student *insert(student*head); //指针函数*insert()用来添加职工信息. student *cancel(student *head,long id); //指针函数*cancel()用来删除职工信息. student *find(student *head,long id); //指针函数*find()用来查找职工信息. student *modify(student *head,long id); //指针函数*modife()用来修改职工的信息. void paixu(student *head); //定义paixu()函数将职工的总额从大到小排列并输出 void average(student *head); //定义职工工资平均值的函数void save(student *head); //保存文件信息

C语言中常用的库函数

字符处理函数 本类别函数用于对单个字符进行处理,包括字符的类别测试和字符的大小写转换 头文件ctype.h 函数列表<> 函数类别函数用途详细说明 字符测试是否字母和数字isalnum 是否字母isalpha 是否控制字符iscntrl 是否数字isdigit 是否可显示字符(除空格外)isgraph 是否可显示字符(包括空格)isprint 是否既不是空格,又不是字母和数字的可显示字符ispunct 是否空格isspace 是否大写字母isupper 是否16进制数字(0-9,A-F)字符isxdigit 字符大小写转换函数转换为大写字母toupper 转换为小写字母tolower 地区化 本类别的函数用于处理不同国家的语言差异。 头文件local.h 函数列表 函数类别函数用途详细说明 地区控制地区设置setlocale 数字格式约定查询国家的货币、日期、时间等的格式转换localeconv 数学函数 本分类给出了各种数学计算函数,必须提醒的是ANSI C标准中的数据格式并不符合IEEE754标准,一些C语言编译器却遵循IEEE754(例如frinklin C51) 头文件math.h 函数列表 函数类别函数用途详细说明 错误条件处理定义域错误(函数的输入参数值不在规定的范围内) 值域错误(函数的返回值不在规定的范围内) 三角函数反余弦acos 反正弦asin

反正切atan 反正切2 atan2 余弦cos 正弦sin 正切tan 双曲函数双曲余弦cosh 双曲正弦sinh 双曲正切tanh 指数和对数指数函数exp 指数分解函数frexp 乘积指数函数fdexp 自然对数log 以10为底的对数log10 浮点数分解函数modf 幂函数幂函数pow 平方根函数sqrt 整数截断,绝对值和求余数函数求下限接近整数ceil 绝对值fabs 求上限接近整数floor 求余数fmod 本分类函数用于实现在不同底函数之间直接跳转代码。头文件setjmp.h io.h 函数列表 函数类别函数用途详细说明 保存调用环境setjmp 恢复调用环境longjmp 信号处理 该分类函数用于处理那些在程序执行过程中发生例外的情况。 头文件signal.h 函数列表 函数类别函数用途详细说明 指定信号处理函数signal 发送信号raise 可变参数处理 本类函数用于实现诸如printf,scanf等参数数量可变底函数。

c语言工资管理系统课程设计

程序设计课程设计报告 工资管理系统 院系:地质工程系 班级:地质工程班 组员:陈欣永 胡世俊 李积荣赵海俊 马小成

目录 一、设计目的 (1) 二、设计内容与要求 (2) 1.设计内容 (3) 2.设计要求 (4) 三、总流程图设计 (5) 四、程序详细功能设计 (6) 五、程序调试 (7) 六、设计小结 (8) 七、参考文献 (9) 附录 (10) 1

一、设计目的 在计算机中建立相应的数据结构,利用程序实现工资的输入、查询、增、删、改、统计、输出等操作。 进一步掌握利用C语言进行程序设计的能力;进一步理解和运用结构化程序设计的思想和方法;初步掌握开发一个小型实用系统的基本方法;学会调试一个较长程序的基本方法;学会利用流程图表示算法。 《工资管理系统》的设计与实现,此次程序设计主要利用c语言的基础知识开发一个简单的职工工资管理系统。工资管理系统是一个企业不可缺少的一部分,它利用计算机对职工工资进行统一管理,实现工资管理工作的系统化、规范化和自动化,为企业提高工作效率。 二、设计内容与要求

1.设计内容 主要利用c语言的文件操作能力设计开发一个小型的管理信息系统,至少具有如下功能:对职工信息的录入、修改或删除,通过职工姓名或工号进行查找,并逐项列出相信的职工工资信息,另外也可以查看所有职工目前的工资状况。有一个文本菜单来调用各个功能的函数及一个主菜单来提示用户如何操作。 2.设计要求 在计算机中建立相应的数据结构,利用程序实现工资的输入、查询、增、删、改、统计、输出等操作。 三、总体流程图设计 3

四、程序详细功能设计 1、设计一个能够记录公司职工工资的数据结构,每条记录包括:职工号,姓名,基本工资,职务工资,津贴。 2、应用文件保存工资管理数据。 3、新增:能将所有输入的职工工资数据保存到文件中,并可选择继续输入或退出。

C语言常用的库函数

库函数并不是C语言的一部分,它是由编译系统根据一般用户的需要编制并 提供给用户使用的一组程序。每一种C编译系统都提供了一批库函数,不同的 编译系统所提供的库函数的数目和函数名以及函数功能是不完全相同的。ANSI C标准提出了一批建议提供的标准库函数。它包括了目前多数C编译系统所提供 的库函数,但也有一些是某些C编译系统未曾实现的。考虑到通用性,本附录 列出ANSI C建议的常用库函数。 由于C库函数的种类和数目很多,例如还有屏幕和图形函数、时间日期函数、 与系统有关的函数等,每一类函数又包括各种功能的函数,限于篇幅,本附录不 能全部介绍,只从教学需要的角度列出最基本的。读者在编写C程序时可根据 需要,查阅有关系统的函数使用手册。 1.数学函数 使用数学函数时,应该在源文件中使用预编译命令: #include或#include "math.h" 函数名函数原型功能返回值 acos double acos(double x);计算arccos x的值,其中-1<=x<=1计算结果 asin double asin(double x);计算arcsin x的值,其中-1<=x<=1计算结果 atan double atan(double x);计算arctan x的值计算结果 atan2double atan2(double x, double y);计算arctan x/y的值计算结果 cos double cos(double x);计算cos x的值,其中x的单位为弧度计算结果 cosh double cosh(double x);计算x的双曲余弦cosh x的值计算结果 exp double exp(double x);求e x的值计算结果

小型公司工资管理系统(C)源代码

#include #include #include #include class Employ// 基类- 雇员类{ protected: int num; char name[10]; char sex; int age; int wage; public: virtual void set()=0; virtual void print()=0; virtual void reserved()=0; }; class Manager:public Employ// 经理类 { public: void set(); void print(); void reserved(); }; class Salesman:public Employ// 销售员类{ protected: int salesvolume; int snum; public: void set(); void print(); void reserved(); void printinfor(); int getsales() {return salesvolume;} int getsnum() {return snum;} };

class MarketMan:public Manager// 销售经理类{ protected: int salesvolume; public: void set(); void print(); void reserved(); int resetwage(); int getnum() {return num;} char*getname() {return name;} int getamount(Salesman s[],int n) { salesvolume=0; for(int i=0;i>num; cout<<" 其姓名:"; cin>>name; cout<<" 性别(m/w):"; cin>>sex; cout<<" 年龄:";

C语言常见基本词汇及词汇解释

C语言常用基本词汇及其他提示语运算符与表达式: 1.constant 常量 2. variable 变量 3. identify 标识符 4. keywords 关键字 5. sign 符号 6. operator 运算符 7. statement语句 8. syntax 语法 9. expression 表达式 10. initialition初始化 11. number format 数据格式 12 declaration 说明 13. type conversion 类型转换 14.define 、definition 定义 条件语句: 1.select 选择 2. expression 表达式 3. logical expression 逻辑表达式 4. Relational expression 关系表达式 5.priority优先

6. operation运算 7.structure 结构 循环语句: 1.circle 循环 2. condition 条件 3. variant 变量 4. process过程 5.priority优先 6. operation运算 数组: 1. array 数组 2. reference 引用 3. element 元素 4. address 地址 5. sort 排序 6. character 字符 7. string 字符串 8. application 应用函数: 1.call 调用 2.return value 返回值 3.function 函数

4. declare 声明 5. `parameter 参数 6.static 静态的 7.extern 外部的 指针: 1. pointer 指针 2. argument 参数 3. array 数组 4. declaration 声明 5. represent 表示 6. manipulate 处理 结构体、共用体、链表: 1 structure 结构 2 member成员 3 tag 标记 4 function 函数 5 enumerate 枚举 6 union 联合(共用体) 7 create 创建 8 insert 插入 9 delete 删除 10 modify 修改

C语言函数大全

功能: 异常终止一个进程 用法: void abort(void) 函数名: abs 功能: 求整数的绝对值 用法: int abs(int i) 函数名: absread, abswirte 功能: 绝对磁盘扇区读、写数据 用法: int absread(int drive, int nsects, int sectno, void *buffer) int abswrite(int drive, int nsects, in tsectno, void *buffer 函数名: access 功能: 确定文件的访问权限 用法: int access(const char *filename, int amode) 函数名: acos 功能:反余弦函数 用法: double acos(double x) 函数名: allocmem 功能: 分配DOS存储段 用法:int allocmem(unsigned size, unsigned *seg) 函数名: arc 功能: 画一弧线 用法:void far arc(int x, int y, int stangle, int endangle, int radius)函数名: asctime 功能: 转换日期和时间为ASCII码 用法:char *asctime(const struct tm *tblock) 函数名: asin 功能:反正弦函数 用法: double asin(double x) 函数名: assert 功能: 测试一个条件并可能使程序终止 用法:void assert(int test) 函数名: atan 功能: 反正切函数 用法: double atan(double x)

C语言文件操作函数大全(超详细)

fopen(打开文件) 相关函数 open,fclose 表头文件 #include 定义函数 FILE * fopen(const char * path,const char * mode); 函数说明参数path字符串包含欲打开的文件路径及文件名,参数mode字符串则代表着流形态。 mode有下列几种形态字符串: r 打开只读文件,该文件必须存在。 r+ 打开可读写的文件,该文件必须存在。 w 打开只写文件,若文件存在则文件长度清为0,即该文件内容会消失。若文件不存在则建立该文件。 w+ 打开可读写文件,若文件存在则文件长度清为零,即该文件内容会消失。若文件不存在则建立该文件。 a 以附加的方式打开只写文件。若文件不存在,则会建立该文件,如果文件存在,写入的数据会被加到文件尾,即文件原先的内容会被保留。 a+ 以附加方式打开可读写的文件。若文件不存在,则会建立该文件,如果文件存在,写入的数据会被加到文件尾后,即文件原先的内容会被保留。 复制代码代码如下: r Open text file for reading. The stream is positioned at the begin ning of the file. r+ Open for reading and writing. The stream is positioned at the begi nning of the file. w Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.

c语言工资管理系统课程设计

程序设计课程设计报告工资管理系统 院系:地质工程系 班级:地质工程班 组员:陈欣永胡世俊 李积荣赵海俊 马小成

目录 一、设计目的 (1) 二、设计内容与要求 (2) 1.设计内容 (3) 2.设计要求 (4) 三、总流程图设计 (5) 四、程序详细功能设计 (6) 五、程序调试 (7) 六、设计小结 (8) 七、参考文献 (9) 附录 (10)

一、设计目的 在计算机中建立相应的数据结构,利用程序实现工资的输入、查询、增、删、改、统计、输出等操作。 进一步掌握利用C语言进行程序设计的能力;进一步理解和运用结构化程序设计的思想和方法;初步掌握开发一个小型实用系统的基本方法;学会调试一个较长程序的基本方法;学会利用流程图表示算法。 《工资管理系统》的设计与实现,此次程序设计主要利用c语言的基础知识开发一个简单的职工工资管理系统。工资管理系统是一个企业不可缺少的一部分,它利用计算机对职工工资进行统一管理,实现工资管理工作的系统化、规范化和自动化,为企业提高工作效率。

二、设计内容与要求 1.设计内容 主要利用c语言的文件操作能力设计开发一个小型的管理信息系统,至少具有如下功能:对职工信息的录入、修改或删除,通过职工姓名或工号进行查找,并逐项列出相信的职工工资信息,另外也可以查看所有职工目前的工资状况。有一个文本菜单来调用各个功能的函数及一个主菜单来提示用户如何操作。 2.设计要求 在计算机中建立相应的数据结构,利用程序实现工资的输入、查询、增、删、改、统计、输出等操作。 三、总体流程图设计

四、程序详细功能设计 1、设计一个能够记录公司职工工资的数据结构,每条记录包括:职工号,姓名,基本工资,职务工资,津贴。 2、应用文件保存工资管理数据。 3、新增:能将所有输入的职工工资数据保存到文件中,并可选择继续输入或退出。

c语言中常用的函数和头文件

头文件ctype.h 函数列表<> 函数类别函数用途详细说明 字符测试是否字母和数字isalnum 是否字母isalpha 是否控制字符iscntrl 是否数字isdigit 是否可显示字符(除空格外)isgraph 是否可显示字符(包括空格)isprint 是否既不是空格,又不是字母和数字的可显示字符ispunct 是否空格isspace 是否大写字母isupper 是否16进制数字(0-9,A-F)字符isxdigit 字符大小写转换函数转换为大写字母toupper 转换为小写字母tolower 地区化 本类别的函数用于处理不同国家的语言差异。 头文件local.h 函数列表 函数类别函数用途详细说明 地区控制地区设置setlocale 数字格式约定查询国家的货币、日期、时间等的格式转换localeconv 数学函数 本分类给出了各种数学计算函数,必须提醒的是ANSI C标准中的数据格式并不符合IEEE754标准,一些C语言编译器却遵循IEEE754(例如frinklin C51) 头文件math.h 函数列表 函数类别函数用途详细说明 错误条件处理定义域错误(函数的输入参数值不在规定的范围内) 值域错误(函数的返回值不在规定的范围内) 三角函数反余弦acos 反正弦asin 反正切atan 反正切2 atan2 余弦cos

正弦sin 正切tan 双曲函数双曲余弦cosh 双曲正弦sinh 双曲正切tanh 指数和对数指数函数exp 指数分解函数frexp 乘积指数函数fdexp 自然对数log 以10为底的对数log10 浮点数分解函数modf 幂函数幂函数pow 平方根函数sqrt 整数截断,绝对值和求余数函数求下限接近整数ceil 绝对值fabs 求上限接近整数floor 求余数fmod 本分类函数用于实现在不同底函数之间直接跳转代码。头文件setjmp.h io.h 函数列表 函数类别函数用途详细说明 保存调用环境setjmp 恢复调用环境longjmp 信号处理 该分类函数用于处理那些在程序执行过程中发生例外的情况。 头文件signal.h 函数列表 函数类别函数用途详细说明 指定信号处理函数signal 发送信号raise 可变参数处理 本类函数用于实现诸如printf,scanf等参数数量可变底函数。 头文件stdarg.h 函数列表

C语言中最常用标准库函数 - candyliuxj - CSDN博客

C语言中最常用标准库函数- candyliuxj - CSDN博客 C语言中最常用标准库函数收藏 标准头文件包括: <asset.h> <ctype.h> <errno.h> <float.h> <limits.h> <locale.h> <math.h> <setjmp.h> <signal.h> <stdarg.h> <stddef.h> <stdlib.h> <stdio.h> <string.h> <time.h> 一、标准定义(<stddef.h>) 文件<stddef.h>里包含了标准库的一些常用定义,无论我们包含哪个标准头文件,<stddef.h>都会被自动包含进来。 这个文件里定义: l 类型size_t (sizeof运算符的结果类型,是某个无符号整型); l 类型ptrdiff_t(两个指针相减运算的结果类型,是某个有符号整型);

l 类型wchar_t (宽字符类型,是一个整型,其中足以存放本系统所支持的所有本地环境中的 字符集的所有编码值。这里还保证空字符的编码值为0); l 符号常量NULL (空指针值); l 宏offsetor (这是一个带参数的宏,第一个参数应是一个结构类型,第二个参数应是结构 成员名。offsetor(s,m)求出成员m在结构类型t的变量里的偏移量)。 注:其中有些定义也出现在其他头文件里(如NULL)。 二、错误信息(<errno.h>) <errno.h>定义了一个int类型的表达式errno,可以看作一个变量,其初始值为0,一些标准库函数执行中出错时将它设为非0值,但任何标准库函数都设置它为0。 <errno.h>里还定义了两个宏EDOM和ERANGE,都是非0的整数值。数学函数执行中遇到参数错误,就会将errno 置为EDOM,如出现值域错误就会将errno置为ERANGE。 三、输入输出函数(<stdio.h>) 文件打开和关闭: FILE *fopen(const char *filename, const char *mode); int fclose(FILE * stream);

C语言库函数

分类函数,所在函数库为ctype.h int isalpha(int ch) 若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0 int isalnum(int ch) 若ch是字母('A'-'Z','a'-'z')或数字('0'-'9') 返回非0值,否则返回0 int isascii(int ch) 若ch是字符(ASCII码中的0-127)返回非0值,否则返回0 int iscntrl(int ch) 若ch是作废字符(0x7F)或普通控制字符(0x00-0x1F) 返回非0值,否则返回0 int isdigit(int ch) 若ch是数字('0'-'9')返回非0值,否则返回0 int isgraph(int ch) 若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0 int islower(int ch) 若ch是小写字母('a'-'z')返回非0值,否则返回0 int isprint(int ch) 若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0 int ispunct(int ch) 若ch是标点字符(0x00-0x1F)返回非0值,否则返回0 int isspace(int ch) 若ch是空格(' '),水平制表符('\t'),回车符('\r'), 走纸换行('\f'),垂直制表符('\v'),换行符('\n') 返回非0值,否则返回0 int isupper(int ch) 若ch是大写字母('A'-'Z')返回非0值,否则返回0 int isxdigit(int ch) 若ch是16进制数('0'-'9','A'-'F','a'-'f')返回非0值, 否则返回0 int tolower(int ch) 若ch是大写字母('A'-'Z')返回相应的小写字母('a'-'z') int toupper(int ch) 若ch是小写字母('a'-'z')返回相应的大写字母('A'-'Z') 数学函数,所在函数库为math.h、stdlib.h、string.h、float.h int abs(int i) 返回整型参数i的绝对值 double cabs(struct complex znum) 返回复数znum的绝对值 double fabs(double x) 返回双精度参数x的绝对值 long labs(long n) 返回长整型参数n的绝对值 double exp(double x) 返回指数函数ex的值 double frexp(double value,int *eptr) 返回value=x*2n中x的值,n存贮在eptr中

相关文档
最新文档