当前位置:网站首页>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 

边栏推荐
- Rotate the square array of two-dimensional array clockwise by 90 °
- leetcode_ 1470_ 2021.10.12
- C language - keyword 1
- leetcode:515. Find the maximum value in each tree row [brainless BFS]
- 04A中断的配置
- [notes of Wu Enda] convolutional neural network
- 02--- impossible phenomenon of longitudinal wave
- PostMan工具介绍及安装使用
- Yida technology signed a contract with seven wolves to help the digital transformation of "Chinese men's wear leader"
- That is to say, "live broadcast" is launched! One stop live broadcast service with full link upgrade
猜你喜欢

权限想要细化到按钮,怎么做?

leetcode_ 191_ 2021-10-15

使用region折叠代码

Detailed explanation of agency mode

Yida technology signed a contract with seven wolves to help the digital transformation of "Chinese men's wear leader"

You are using pip version 21.1.2; however, version 22.1.2 is available
![[notes of wuenda] fundamentals of machine learning](/img/71/6192a75446fa7f79469a5483ececc6.jpg)
[notes of wuenda] fundamentals of machine learning

SAP interface debug setting external breakpoints

PyCharm 中出现Cannot find reference ‘imread‘ in ‘__init__.py‘

华大04a工作模式/低功耗模式
随机推荐
面试官:你说你精通Redis,你看过持久化的配置吗?
leetcode_ 191_ 2021-10-15
系统测试主要步骤
How to extract dates from web pages?
Flutter: Unsupported value: false/true
Detailed installation and use of performance test tool wrk
基于 KubeSphere 的分级管理实践
Guava中这些Map的骚操作,让我的代码量减少了50%
Excel布局
MySQL gets fields and comments by indicating
机器学习:梯度下降法
leetcode_ one thousand three hundred and sixty-five
You are using pip version 21.1.2; however, version 22.1.2 is available
You are using pip version 21.1.2; however, version 22.1.2 is available
02--- impossible phenomenon of longitudinal wave
Collective search + drawing creation
[notes of wuenda] fundamentals of machine learning
理想L9,智能座舱新潮流
拖动拖动拖动
壹沓科技签约七匹狼,助力「中国男装领导者」数字化转型