Embedded Linux (Raspberry Pi)

putty
Raspberry Pi 3B+

1. Raspberry Pi executes the .c file

  1. Create the file using the command nano helloworld.c commandnano hello.c
  2. Edit the code as follows
    insert image description here
#include <assert.h>
#include <stdio.h>
 
int main()
{
    
    
   int x;
   char str[40];
     
   printf("请输入一个大于10整数值: ");
   scanf("%d", &x);
   assert(x > 10);
   printf("输入的整数是: %d\n", x);
    
   printf("请输入字符串: ");
   scanf("%s", str);
   assert(str != NULL);
   printf("输入的字符串是: %s\n", str);
    
   return(0);
}




  1. Use the gcc tool to compile and run
    to compile in one step:gcc hello.c -o hello

insert image description here

  1. run:./hello
    insert image description here

2. Use the scp command to practice file copy and transfer

  1. File content on Ubuntu
    insert image description here

  2. Use the command scp on Ubuntu

scp 本地Linux系统文件路径 远程用户名@IP地址:远程系统文件绝对路径名

insert image description here

  1. Raspberry Pi received successfully

insert image description here

insert image description here

Guess you like

Origin blog.csdn.net/Mouer__/article/details/125304976