當前位置:首頁 » 編程語言 » c語言execl函數
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

c語言execl函數

發布時間: 2022-12-31 17:59:10

A. c語言如何操作excel文件

1.寫操作 第一步:單純C語言寫入Excel文件只能是 *.csv的後綴文件(是和txt一樣,以二進制文本形式存儲,它是以都逗號分隔符做個單元格內容的劃分, .xls存儲比較復雜,
2.讀操作 讀取文件 對於讀取Excel文件的操作,使用了文件隨機定位函數fseek(),它的一般調用格式
3.最新補充 2018.08.28 由於經常有朋友告訴我運行結果是0

B. C語言函數的進程函數

所在函數庫為stdlib.h、process.h
void abort() 此函數通過調用具有出口代碼3的_exit寫一個終止信息於
stderr,並異常終止程序 無返回值
int exec…裝入和運行其它程序
int execl( char *pathname,char *arg0,char *arg1,…,char *argn,NULL)
int execle( char *pathname,char *arg0,char *arg1,…,
char *argn,NULL,char *envp[])
int execlp( char *pathname,char *arg0,char *arg1,…,NULL)
int execlpe(char *pathname,char *arg0,char *arg1,…,NULL,char *envp[])
int execv( char *pathname,char *argv[])
int execve( char *pathname,char *argv[],char *envp[])
int execvp( char *pathname,char *argv[])
int execvpe(char *pathname,char *argv[],char *envp[])
exec函數族裝入並運行程序pathname,並將參數
arg0(arg1,arg2,argv[],envp[])傳遞給子程序,出錯返回-1
在exec函數族中,後綴l、v、p、e添加到exec後,
所指定的函數將具有某種操作能力
有後綴 p時,函數可以利用DOS的PATH變數查找子程序文件
l時,函數中被傳遞的參數個數固定
v時,函數中被傳遞的參數個數不固定
e時,函數傳遞指定參數envp,允許改變子進程的環境,
無後綴e時,子進程使用當前程序的環境
void _exit(int status)終止當前程序,但不清理現場
void exit(int status) 終止當前程序,關閉所有文件,寫緩沖區的輸出(等待輸出),
並調用任何寄存器的出口函數,無返回值
int spawn…運行子程序
int spawnl( int mode,char *pathname,char *arg0,char *arg1,…,
char *argn,NULL)
int spawnle( int mode,char *pathname,char *arg0,char *arg1,…,
char *argn,NULL,char *envp[])
int spawnlp( int mode,char *pathname,char *arg0,char *arg1,…,
char *argn,NULL)
int spawnlpe(int mode,char *pathname,char *arg0,char *arg1,…,
char *argn,NULL,char *envp[])
int spawnv( int mode,char *pathname,char *argv[])
int spawnve( int mode,char *pathname,char *argv[],char *envp[])
int spawnvp( int mode,char *pathname,char *argv[])
int spawnvpe(int mode,char *pathname,char *argv[],char *envp[])
spawn函數族在mode模式下運行子程序pathname,並將參數
arg0(arg1,arg2,argv[],envp[])傳遞給子程序.出錯返回-1
mode為運行模式
mode為 P_WAIT 表示在子程序運行完後返回本程序
P_NOWAIT 表示在子程序運行時同時運行本程序(不可用)
P_OVERLAY表示在本程序退出後運行子程序
在spawn函數族中,後綴l、v、p、e添加到spawn後,
所指定的函數將具有某種操作能力
有後綴 p時, 函數利用DOS的PATH查找子程序文件
l時, 函數傳遞的參數個數固定.
v時, 函數傳遞的參數個數不固定.
e時, 指定參數envp可以傳遞給子程序,允許改變子程序運行環境.
當無後綴e時,子程序使用本程序的環境.
int system(char *command) 將MSDOS命令command傳遞給DOS執行
轉換子程序,函數庫為math.h、stdlib.h、ctype.h、float.h
char *ecvt(double value,int ndigit,int *decpt,int *sign)
將浮點數value轉換成字元串並返回該字元串
char *fcvt(double value,int ndigit,int *decpt,int *sign)
將浮點數value轉換成字元串並返回該字元串
char *gcvt(double value,int ndigit,char *buf)
將數value轉換成字元串並存於buf中,並返回buf的指針
char *ultoa(unsigned long value,char *string,int radix)
將無符號整型數value轉換成字元串並返回該字元串,radix為轉換時所用基數
char *ltoa(long value,char *string,int radix)
將長整型數value轉換成字元串並返回該字元串,radix為轉換時所用基數
char *itoa(int value,char *string,int radix)
將整數value轉換成字元串存入string,radix為轉換時所用基數
double atof(char *nptr) 將字元串nptr轉換成雙精度數,並返回這個數,錯誤返回0
int atoi(char *nptr) 將字元串nptr轉換成整型數, 並返回這個數,錯誤返回0
long atol(char *nptr) 將字元串nptr轉換成長整型數,並返回這個數,錯誤返回0
double strtod(char *str,char **endptr)將字元串str轉換成雙精度數,並返回這個數,
long strtol(char *str,char **endptr,int base)將字元串str轉換成長整型數,
並返回這個數,
int toascii(int c) 返回c相應的ASCII
int tolower(int ch) 若ch是大寫字母('A'-'Z')返回相應的小寫字母('a'-'z')
int _tolower(int ch) 返回ch相應的小寫字母('a'-'z')
int toupper(int ch) 若ch是小寫字母('a'-'z')返回相應的大寫字母('A'-'Z')
int _toupper(int ch) 返回ch相應的大寫字母('A'-'Z')

C. 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);
字元輸入輸出:
int fgetc(FILE *fp);
int fputc(int c, FILE *fp);
getc和putc與這兩個函數類似,但通過宏定義實現。通常有下面定義:
#define getchar() getc(stdin)
#define putchar(c) putc(c, stdout)
int ungetc(int c, FILE* stream);//把字元 c 退迴流 stream
格式化輸入輸出:
int scanf(const char *format, ...);
int printf(const char *format, ...);
int fscanf(FILE *stream, const char *format, ...);
int fprintf(FILE *stream, const char *format, ...);
int sscanf(char *s, const char *format, ...);
int sprintf(char *s, const char *format, ...);
行式輸入輸出:
char *fgets(char *buffer, int n, FILE *stream);
int fputs(const char *buffer, FILE *stream);
char *gets(char *s);
int puts(const char *s);
直接輸入輸出:
size_t fread(void *pointer, size_t size, size_t num, FILE *stream);
size_t fwrite(const void *pointer, size_t size, size_t num, FILE *stream);

D. C語言函數和EXCEL函數

首先聲明,C語言和Excel完全不是一回事情:C語言是編程(尤其針對硬體有效的),Excel是辦公中的應用軟體(支持VBS或者宏編程)。你所看到的只是重名現象而已。不可當真,不過你不怕混淆可以方便你同時學習的時候記憶。printf:列印輸出到屏幕。scanf:從鍵盤輸入。getchar:獲得一個字元。