C语言库函数的原型,有用的拿去

源代码在线查看: div.c

软件大小: 3272 K
上传用户: kens
关键词: C语言 库函数 原型
下载地址: 免注册下载 普通下载 VIP

相关代码

				/***
				*div.c - contains the div routine
				*
				*       Copyright (c) Microsoft Corporation. All rights reserved.
				*
				*Purpose:
				*       Performs a signed divide and returns quotient
				*       and remainder.
				*
				*******************************************************************************/
				
				#include 
				#include 
				
				/***
				*div_t div(int numer, int denom) - do signed divide
				*
				*Purpose:
				*       This routine does an divide and returns the results.
				*
				*Entry:
				*       int numer - Numerator passed in on stack
				*       int denom - Denominator passed in on stack
				*
				*Exit:
				*       returns quotient and remainder in structure
				*
				*Exceptions:
				*       No validation is done on [denom]* thus, if [denom] is 0,
				*       this routine will trap.
				*
				*******************************************************************************/
				
				div_t __cdecl div (
				        int numer,
				        int denom
				        )
				{
				        div_t result;
				
				        result.quot = numer / denom;
				        result.rem = numer % denom;
				
				        return result;
				}
							

相关资源