C:crypt函数 [英] C : crypt function

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

问题描述

我已经使用了crypt函数在C给定的加密字符串。
我写了下面的code,

I have used the crypt function in c to encrypt the given string. I have written the following code,

#include<stdio.h>
#include<unistd.h>

int main()
{
printf("%s\n",crypt("passwd",1000));
}

但上面的code扔了一个错误,未定义参考`隐窝'。
什么是在上面的code中的问题。

But the above code threw an error ,"undefined reference to `crypt'". What is the problem in the above code.

先谢谢了。

推荐答案

如果你想使用的crypt()功能,您需要链接到crypt库。 -lcrypt 添加到您的编译命令(如手册页告诉你!)。

If you want to use the crypt() function, you need to link to the crypt library. Add -lcrypt to your compile command (as the man page tells you to!).

这篇关于C:crypt函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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