1.c?语言s语言源码???strsub????Դ??
2.如何创建.in文件?
c????strsub????Դ??
#include <stdio.h>
int strat( char *s, char c )
{
while ( *s )
{
if ( *s==c )
return 1;
s++;
}
return 0;
}
char *strsub( char *s, char *q)
{
char *t=s,*new_s=s;
while ( *t )
{
if ( !strat( q, *t) )
*new_s++ = *t ;
t++;
}
*new_s='\0';
return s;
}
void main()
{
char str1[]="abcdefg";
char str2[]="abc" ;
char *p=strsub( str1,str2);
printf("%s\n", p );
}
如何创建.in文件?
public class IniOP
{
#region 声明读写INI文件的API函数
[DllImport("kernel")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
#endregion
#region 变量声明
//初始化路径名,主键名,函函数字符串长度,数源这里需要加一个说明,在对应函数才需要做类似操作,语言s语言源码康师傅流量源码初始值应该为空
private string m_strFilePath = "";
private string m_strKey = "";
private string m_strSubKey = "";
private int m_intSize = ;
private string _strFilePath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\Default.ini";
private string _strKey = "ErrorKeyIsNull";
private string _strSubKey = "ErrorSubKeyIsNull";
#endregion
#region 属性设置
//设置路径属性
public string FilePath { get { return m_strFilePath; } set { m_strFilePath = value; } }
//设置主键名属性
public string Key { get { return m_strKey; } set { m_strKey = value; } }
//设置字符串长度属性
public int Size { get { return m_intSize; } set { m_intSize = value; } }
//设置子键名属性
public string SubKey { get { return m_strSubKey; } set { m_strSubKey = value; } }
//版本信息
public static string Version
{
get
{
return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
#endregion
#region 构造函数
//构造函数,函函数无参数
public IniOP()
{
}
//构造函数,数源路径名
public IniOP(string strPath)
{
m_strFilePath = strPath;
}
//构造函数,语言s语言源码路径名,函函数主键名
public IniOP(string strPath,数源 string strKey)
{
m_strFilePath = strPath;
m_strKey = strKey;
}
//构造函数,路径名,语言s语言源码主键名,函函数源码出售连我巴巴字符串长度
public IniOP(string strPath,数源 string strKey, int intSize)
{
m_strFilePath = strPath;
m_strKey = strKey;
m_intSize = intSize;
}
//构造函数,路径名,语言s语言源码主键名,函函数字符串长度,数源子键名
public IniOP(string strPath,鬼见愁分时指标源码 string strKey, int intSize, string strSubKey)
{
m_strFilePath = strPath;
m_strKey = strKey;
m_intSize = intSize;
m_strSubKey = strSubKey;
}
#endregion
#region 写入ini文件时的默认值判断
private void IniCheckDefaultValue()
{
if (m_strFilePath == "" || System.IO.File.Exists(m_strFilePath) == false)
{
_strFilePath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\Default.ini";
}
else
{
_strFilePath = m_strFilePath;
}
if (m_strKey == "")
{
_strKey = "ErrorKeyIsNull_" + System.DateTime.Now.ToString("yyyyMMddHHmmss");
}
else
{
_strKey = m_strKey;
}
if (m_strSubKey == "")
{
_strSubKey = "ErrorSubKeyIsNull_" + System.DateTime.Now.ToString("yyyyMMddHHmmss");
}
else
{
_strSubKey = m_strSubKey;
}
}
#endregion
#region 写入文件函数(非静态)
//写INI文件,输入键值
public void WriteValue(string strValue)
{
IniCheckDefaultValue();
WritePrivateProfileString(_strKey, _strSubKey, strValue, _strFilePath);
}
//写INI文件,输入子键名,键值
public void WriteValue(string strSubKey, string strValue)
{
IniCheckDefaultValue();
WritePrivateProfileString(_strKey, strSubKey, strValue, _strFilePath);
}
//写INI文件,输入主键名,子键名,美丽世界辅助源码键值
public void WriteValue(string strKey, string strSubKey, string strValue)
{
IniCheckDefaultValue();
WritePrivateProfileString(strKey, strSubKey, strValue, _strFilePath);
}
//写INI文件,输入主键名,子键名,文件路径,键值
public void WriteValue(string strKey,ahk找色源码 string strSubKey, string strPath, string strValue)
{
WritePrivateProfileString(strKey, strSubKey, strValue, strPath);
}
#endregion
#region 写入文件函数(静态)
//写INI文件,输入主键名,子键名,文件路径,键值
public static void staticWriteValue(string strKey, string strSubKey, string strPath, string strValue)
{
WritePrivateProfileString(strKey, strSubKey, strValue, strPath);
}
#endregion
#region 读取文件函数(非静态)
//读取INI文件,所有参数提前设置好
public string ReadValue()
{
StringBuilder strTemp = new StringBuilder(m_intSize);
int i = GetPrivateProfileString(m_strKey, m_strSubKey, "", strTemp, m_intSize, m_strFilePath);
return strTemp.ToString();
}
//读取INI文件,输入子键名
public string ReadValue(string strSubKey)
{
StringBuilder strTemp = new StringBuilder(m_intSize);
int i = GetPrivateProfileString(m_strKey, strSubKey, "", strTemp, m_intSize, m_strFilePath);
return strTemp.ToString();
}
//读取INI文件,输入主键名,子键名
public string ReadValue(string strKey, string strSubKey)
{
StringBuilder strTemp = new StringBuilder(m_intSize);
int i = GetPrivateProfileString(strKey, strSubKey, "", strTemp, m_intSize, m_strFilePath);
return strTemp.ToString();
}
//读取INI文件,输入主键名,子键名,文件路径
public string ReadValue(string strKey, string strSubKey, string strPath)
{
StringBuilder strTemp = new StringBuilder(m_intSize);
int i = GetPrivateProfileString(strKey, strSubKey, "", strTemp, m_intSize, strPath);
return strTemp.ToString();
}
//读取INI文件,输入主键名,子键名,取字符串长度
public string ReadValue(string strKey, string strSubKey, int intSize)
{
StringBuilder strTemp = new StringBuilder(intSize);
int i = GetPrivateProfileString(strKey, strSubKey, "", strTemp, intSize, m_strFilePath);
return strTemp.ToString();
}
//读取INI文件,输入主键名,子键名,文件路径,取字符串长度
public string ReadValue(string strKey, string strSubKey, string strPath, int intSize)
{
StringBuilder strTemp = new StringBuilder(intSize);
int i = GetPrivateProfileString(strKey, strSubKey, "", strTemp, intSize, strPath);
return strTemp.ToString();
}
#endregion
#region 读取文件函数(静态)
//读取INI文件,输入主键名,子键名,文件路径,取字符串长度
public static string staticReadValue(string strKey, string strSubKey, string strPath, int intSize)
{
StringBuilder strTemp = new StringBuilder(intSize);
int i = GetPrivateProfileString(strKey, strSubKey, "", strTemp, intSize, strPath);
return strTemp.ToString();
}
#endregion
}
//
2024-12-26 02:59357人浏览
2024-12-26 02:49250人浏览
2024-12-26 01:551089人浏览
2024-12-26 01:472142人浏览
2024-12-26 01:352721人浏览
2024-12-26 01:281119人浏览
1.å¦ä½ç解CompassåHibernateçç»å使ç¨2.feather函数简介3.ElasticSearch系列连载1. ES版本与开源简介4.开发自己的搜
1.博客代码放在博客的什么位置2.微信公众平台开发模式代码放置的位置是哪里?比如:是放在当初验证token的类里,还是其他位置?3.怎样在自己的网页中加入播放器博客代码放在博客的什么位置 将博客代
一蛋難求,宜蘭卻出現蛋商在網路販售雞蛋,還開名車到現場面交。雖然有網友質疑,是不是因為進口蛋抵台,才開始拋售雞蛋?但縣府表示,目前沒有接獲相關消息,也提醒民眾,盡量購買有標示來源的雞蛋,維護食用安全。