c中作为函数参数的字符指针 [英] pointer of character in as function parameter in c

查看:66
本文介绍了c中作为函数参数的字符指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有接受来自用户的字符串的函数



i have function that accept string from user

int findAscii(char* n)
 
   {
 
    //function body here
}








and

int findAscii(char *n)
 
{
 
//function body here
}





问题是两个函数中的n值是否相同? (函数是等价的?)



the question is does n have the same value in both functions ? (functions are equivalent ?)

推荐答案

你的参数类型是char *,名称是n。你放在哪里*,(char *)n或(char *)n是等价的无关紧要
the type of your argument is char* and the name is n. It does not matter where you put *, (char*)n or (char *)n is equivalent


这篇关于c中作为函数参数的字符指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆