我只是从 C 开始,我想制作一个程序,以小写字母显示字母,在一行上,按升序,从字母“a”开始。它应该以这种方式进行原型
void ft_print_alphabet(void);
我正在尝试此代码,但它不起作用。
void ft_putchar(char c);
void ft_print_alphabet(void)
{
char letter;
letter = 'a';
while (letter <= 'z')
{
ft_putchar(letter);
letter++;
}
}
int main(void)
{
ft_print_alphabet();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我使用 gcc 编译它(因为它是我们必须使用的),如下所示:gcc -o ftpp ftpp.c 但是我一直收到这个错误
Undefined symbols for architecture x86_64:
"_ft_putchar", referenced from:
_ft_print_alphabet in ft_print_alphabet-3d7c19.o
ld: symbol(s) not found for architecture x86_64
Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的 nginx 网络服务器上启动我的节点服务,但是当我尝试执行 nginx -t 时我不断收到此错误
nginx: [emerg] "upstream" directive is not allowed here in /etc/nginx/nginx.conf:3
nginx: configuration file /etc/nginx/nginx.conf test failed
Run Code Online (Sandbox Code Playgroud)
我目前的 nginx.conf 是这样的:
upstream backend {
server 127.0.0.1:5555;
}
map $sent_http_content_type $charset {
~^text/ utf-8;
}
server {
listen 80;
listen [::]:80;
server_name mywebsite.com;
server_tokens off;
client_max_body_size 100M; # Change this to the max file size you want to allow
charset $charset;
charset_types *;
# Uncomment if you are running behind CloudFlare.
# This requires NGINX compiled from …Run Code Online (Sandbox Code Playgroud) 我正在尝试执行一个给出多行的命令;例如ldapwhoami,我想在只打印最后一行而不是所有命令行的 bash 脚本中制作它。我尝试了以下
#/bin/bash
$(ldapwhoami | sed 1d2d3d)
Run Code Online (Sandbox Code Playgroud)
但它似乎不起作用,任何帮助将不胜感激。