当前位置:网站首页>Raspberry pie preliminary use
Raspberry pie preliminary use
2022-06-24 22:12:00 【@Mountains and rivers】
List of articles
One 、 Create a new user
Create user :
sudo useradd -m user name
Set the password :
sudo passwd user name
Give users sudo jurisdiction ( The following file transfer needs ):
# Switch to root user
sudo su
# Edit profile
vi /etc/sudoers
# Increase the configuration ( Press i Start editing ,Esc Exit the editor ,:wq! Save forced exit ), In the open configuration file , find root ALL=(ALL) ALL, Add a line below
# among xxx Is the name of the user you want to join
xxx ALL=(ALL) ALL
Two 、C Program practice
1. Create a c Program
vi file name .c
2. Get into vi Edit mode , Press i Start writing code
#include <assert.h>
#include <stdio.h>
int main()
{
int a;
char str[50];
printf(" Please enter an integer value : ");
scanf("%d", &a);
assert(a >= 10);
printf(" The integer entered is : %d\n", a);
printf(" Please enter the string : ");
scanf("%s", str);
assert(str != NULL);
printf(" The input string is : %s\n", str);
return(0);
}
3. Press Esc Exit edit mode , Input :wq( Means save and exit )
4. compiler
First program name .c It's the code just written , The second program name is where the code results are output
gcc The program name .c -o The program name
5. Run the program
A program name of the second in the previous step
./ The program name
3、 ... and 、assert() understand
brief introduction
C Standard library assert.h The header file provides a file named assert The macro , It can be used to verify the assumptions made by the program , And output the diagnostic message when it is assumed to be false .
Library macro
assert.h The header file defines a unique function :assert()
void assert(int expression) This is actually a macro , Not a function , Can be used in C Add diagnostics to the program .
C Library macro - assert()
describe :C Library macro void assert(int expression) Allows diagnostic information to be written to the standard error file . let me put it another way , It can be used in C Add diagnostics to the program .
Statement :void assert(int expression);
expression : This can be a variable or anything C expression . If expression by TRUE,assert() Do nothing . If expression by FALSE,assert() Will be in standard error stderr An error message appears on the , And stop the program execution .
Return value : nothing
example :
#include <assert.h>
#include <stdio.h>
int main()
{
int a;
char str[50];
printf(" Please enter an integer value : ");
scanf("%d", &a);
assert(a >= 10);
printf(" The integer entered is : %d\n", a);
printf(" Please enter the string : ");
scanf("%s", str);
assert(str != NULL);
printf(" The input string is : %s\n", str);
return(0);
}
If the entered integer is greater than or equal to 10, The input string is not empty , The program will continue to run ; If the conditions are not met, the program terminates

Four 、 Different Linux File transfer between systems
If in Ubuntu File transfer between system and raspberry pie system
scp Command Introduction
Linux scp The command is used for Linux Copy files and directories between .
scp yes secure copy Abbreviation , scp yes linux Based on ssh Log in for secure remote file copy command .
scp It's encrypted. ,rcp It's not encrypted ,scp yes rcp The enhanced .
application ( Will raspberry pie just created .c File transfer to Ubuntu Next ):
sudo scp test.c [email protected]:/home/xjc/
And then execute scp command , You can successfully upload 

边栏推荐
- Practice of hierarchical management based on kubesphere
- Junior college background, 2 years in Suning, 5 years in Ali. How can I get promoted quickly?
- I really can't do it. After 00, I collapsed and wanted to leave
- 使用region折叠代码
- Elegant custom ThreadPoolExecutor thread pool
- Xinlou: Huawei's seven-year building journey of sports health
- 基于kruskal的最小生成树
- 985 test engineer is hanged. Who is more important in terms of education and experience?
- 想当测试Leader,这6项技能你会吗?
- Object. Defineproperty and reflect Fault tolerance of defineproperty
猜你喜欢

降低pip到指定版本(通過PyCharm昇級pip,在降低到原來版本)

是真干不过00后,给我卷的崩溃,想离职了...

关于自动控制原理资料更新

SAP interface debug setting external breakpoints

PostMan工具介绍及安装使用

基于 KubeSphere 的分级管理实践

try-with-resources 中的一个坑,注意避让

Development trend and path of SaaS industry in China

二叉搜索树模板

The process from troubleshooting to problem solving: the browser suddenly failed to access the web page, error code: 0x80004005, and the final positioning: "when the computer turns on the hotspot, the
随机推荐
Detailed explanation of agency mode
系统测试主要步骤
Object.defineProperty和Reflect.defineProperty的容错问题
I really want to send a bunch of flowers
TKKC round#3
Junior college background, 2 years in Suning, 5 years in Ali. How can I get promoted quickly?
想当测试Leader,这6项技能你会吗?
为什么有的程序员能力一般却能拿到好offer?
【无标题】
Getting started with typescript
Development trend and path of SaaS industry in China
02--- impossible phenomenon of longitudinal wave
[featured] how do you design unified login with multiple accounts?
The process from troubleshooting to problem solving: the browser suddenly failed to access the web page, error code: 0x80004005, and the final positioning: "when the computer turns on the hotspot, the
Binary search tree template
好想送对象一束花呀
Excel layout
面试官:你说你精通Redis,你看过持久化的配置吗?
“阿里健康”们的逻辑早就变了
LeetCode-513. Find the value in the lower left corner of the tree