server.c

来自「这是一个简单的模拟银行存取款的例子,目的是了解如何开发RPC服务程序.代码在LI」· C语言 代码 · 共 17 行

C
17
字号
#include "account.h"int total =  10000;int * deposit_1_svc(int *argp, struct svc_req *rqstp){  static int result;  total = total + *argp;  result = total;  printf("new total = %d \n",total);  return &result;}int * withdraw_1_svc(int *argp, struct svc_req *rqstp){  static int result;  total = total - *argp;  result = total;  printf("new total = %d \n",total);  return &result;  }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?