Rust vs Go:常用语法对比(十二)

alt

题图来自 Rust vs Go in 2023[1]


221. Remove all non-digits characters

Create string t from string s, keeping only digit characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

删除所有非数字字符

package main

import (
 "fmt"
 "regexp"
)

func main() {
 s := `height="168px"`

 re := regexp.MustCompile("[^\\d]")
 t := re.ReplaceAllLiteralString(s, "")

 fmt.Println(t)
}

168


fn main() {
    let t: String = "Today is the 14th of July"
        .chars()
        .filter(|c| c.is_digit(10))
        .collect();

    dbg!(t);
}

[src/main.rs:7] t = "14"


222. Find first index of an element in list

Set i to the first index in list items at which the element x can be found, or -1 if items does not contain x.

在列表中查找元素的第一个索引

package main

import (
 "fmt"
)

func main() {
 items := []string{"huey""dewey""louie"}
 x := "dewey"

 i := -1
 for j, e := range items {
  if e == x {
   i = j
   break
  }
 }

 fmt.Printf("Found %q at position %d in %q", x, i, items)
}

Found "dewey" at position 1 in ["huey" "dewey" "louie"]


fn main() {
    let items = ['A', '🎂', '㍗'];
    let x = '💩';

    match items.iter().position(|y| *y == x) {
        Some(i) => println!("Found {} at position {}.", x, i),
        None => println!("There is no {} in the list.", x),
    }
}

There is no 💩 in the list.

or

fn main() {
    let items = [42, -312];

    {
        let x = 12;

        let i = items.iter().position(|y| *y == x).map_or(-1, |n| n as i32);

        println!("{} => {}", x, i)
    }

    {
        let x = 13;

        let i = items.iter().position(|y| *y == x).map_or(-1, |n| n as i32);

        println!("{} => {}", x, i)
    }
}

12 => 2
13 => -1

223. for else loop

Loop through list items checking a condition. Do something else if no matches are found.
A typical use case is looping through a series of containers looking for one that matches a condition. If found, an item is inserted; otherwise, a new container is created.
These are mostly used as an inner nested loop, and in a location where refactoring inner logic into a separate function reduces clarity.

for else循环

package main

import (
 "fmt"
)

func main() {
 items := []string{"foo""bar""baz""qux"}

 for _, item := range items {
  if item == "baz" {
   fmt.Println("found it")
   goto forelse
  }
 }
 {
  fmt.Println("never found it")
 }
        forelse:
}

found it


fn main() {
    let items: &[&str] = &["foo""bar""baz""qux"];

    let mut found = false;
    for item in items {
        if item == &"baz" {
            println!("found it");
            found = true;
            break;
        }
    }
    if !found {
        println!("never found it");
    }
}

found it

or

fn main() {
     let items: &[&str] = &["foo""bar""baz""qux"];

    if let None = items.iter().find(|&&item| item == "rockstar programmer") {
        println!("NotFound");
    };
}

NotFound

or

fn main() {
    let items: &[&str] = &["foo""bar""baz""qux"];

    items
        .iter()
        .find(|&&item| item == "rockstar programmer")
        .or_else(|| {
            println!("NotFound");
            Some(&"rockstar programmer")
        });
}

NotFound


224. Add element to the beginning of the list

Insert element x at the beginning of list items.

将元素添加到列表的开头

package main

import (
 "fmt"
)

type T int

func main() {
 items := []T{421337}
 var x T = 7
 
 items = append([]T{x}, items...)

 fmt.Println(items)
}

[7 42 1337]

or

package main

import (
 "fmt"
)

type T int

func main() {
 items := []T{421337}
 var x T = 7

 items = append(items, x)
 copy(items[1:], items)
 items[0] = x

 fmt.Println(items)
}

[7 42 1337]


use std::collections::VecDeque;

fn main() {
    let mut items = VecDeque::new();
    items.push_back(22);
    items.push_back(33);
    let x = 11;

    items.push_front(x);

    println!("{:?}", items);
}

[11, 22, 33]


225. Declare and use an optional argument

Declare an optional integer argument x to procedure f, printing out "Present" and its value if it is present, "Not present" otherwise

声明并使用可选参数

package main

func f(x ...int) {
 if len(x) > 0 {
  println("Present", x[0])
 } else {
  println("Not present")
 }
}

func main() {
 f()
 f(1)
}

Go does not have optional arguments, but to some extend, they can be mimicked with a variadic parameter. x is a variadic parameter, which must be the last parameter for the function f. Strictly speaking, x is a list of integers, which might have more than one element. These additional elements are ignored.

Not present
Present 1

fn f(x: Option<()>) {
    match x {
        Some(x) => println!("Present {}", x),
        None => println!("Not present"),
    }
}

226. Delete last element from list

Remove the last element from list items.

从列表中删除最后一个元素

package main

import (
 "fmt"
)

func main() {
 items := []string{"banana""apple""kiwi"}
 fmt.Println(items)

 items = items[:len(items)-1]
 fmt.Println(items)
}
[banana apple kiwi]
[banana apple]

fn main() {
    let mut items = vec![112233];

    items.pop();

    println!("{:?}", items);
}

[11, 22]


227. Copy list

Create new list y containing the same elements as list x.
Subsequent modifications of y must not affect x (except for the contents referenced by the elements themselves if they contain pointers).

复制列表

package main

import (
 "fmt"
)

func main() {
 type T string
 x := []T{"Never""gonna""shower"}

 y := make([]T, len(x))
 copy(y, x)

 y[2] = "give"
 y = append(y, "you""up")

 fmt.Println(x)
 fmt.Println(y)
}

[Never gonna shower]
[Never gonna give you up]

fn main() {
    let mut x = vec![432];

    let y = x.clone();

    x[0] = 99;
    println!("x is {:?}", x);
    println!("y is {:?}", y);
}
x is [9932]
y is [432]

228. Copy a file

Copy the file at path src to dst.

复制文件

package main

import (
 "fmt"
 "io/ioutil"
 "log"
 "os"
)

func main() {
 src, dst := "/tmp/file1""/tmp/file2"

 err := copy(dst, src)
 if err != nil {
  log.Fatalln(err)
 }

 stat, err := os.Stat(dst)
 if err != nil {
  log.Fatalln(err)
 }
 fmt.Println(dst, "exists, it has size", stat.Size(), "and mode", stat.Mode())
}

func copy(dst, src string) error {
 data, err := ioutil.ReadFile(src)
 if err != nil {
  return err
 }
 stat, err := os.Stat(src)
 if err != nil {
  return err
 }
 return ioutil.WriteFile(dst, data, stat.Mode())
}

func init() {
 data := []byte("Hello")
 err := ioutil.WriteFile("/tmp/file1", data, 0644)
 if err != nil {
  log.Fatalln(err)
 }
}

/tmp/file2 exists, it has size 5 and mode -rw-r--r--

or

package main

import (
 "fmt"
 "io/ioutil"
 "log"
 "os"
)

func main() {
 src, dst := "/tmp/file1""/tmp/file2"

 err := copy(dst, src)
 if err != nil {
  log.Fatalln(err)
 }

 stat, err := os.Stat(dst)
 if err != nil {
  log.Fatalln(err)
 }
 fmt.Println(dst, "exists, it has size", stat.Size(), "and mode", stat.Mode())
}

func copy(dst, src string) error {
 data, err := ioutil.ReadFile(src)
 if err != nil {
  return err
 }
 stat, err := os.Stat(src)
 if err != nil {
  return err
 }
 err = ioutil.WriteFile(dst, data, stat.Mode())
 if err != nil {
  return err
 }
 return os.Chmod(dst, stat.Mode())
}

func init() {
 data := []byte("Hello")
 err := ioutil.WriteFile("/tmp/file1", data, 0777)
 if err != nil {
  log.Fatalln(err)
 }
 err = os.Chmod("/tmp/file1"0777)
 if err != nil {
  log.Fatalln(err)
 }
}

/tmp/file2 exists, it has size 5 and mode -rwxrwxrwx

or

package main

import (
 "fmt"
 "io"
 "io/ioutil"
 "log"
 "os"
)

func main() {
 src, dst := "/tmp/file1""/tmp/file2"

 err := copy(dst, src)
 if err != nil {
  log.Fatalln(err)
 }

 stat, err := os.Stat(dst)
 if err != nil {
  log.Fatalln(err)
 }
 fmt.Println(dst, "exists, it has size", stat.Size(), "and mode", stat.Mode())
}

func copy(dst, src string) error {
 f, err := os.Open(src)
 if err != nil {
  return err
 }
 defer f.Close()
 stat, err := f.Stat()
 if err != nil {
  return err
 }
 g, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, stat.Mode())
 if err != nil {
  return err
 }
 defer g.Close()
 _, err = io.Copy(g, f)
 if err != nil {
  return err
 }
 return os.Chmod(dst, stat.Mode())
}

func init() {
 data := []byte("Hello")
 err := ioutil.WriteFile("/tmp/file1", data, 0777)
 if err != nil {
  log.Fatalln(err)
 }
 err = os.Chmod("/tmp/file1"0777)
 if err != nil {
  log.Fatalln(err)
 }
}

/tmp/file2 exists, it has size 5 and mode -rwxrwxrwx


use std::fs;

fn main() {
    let src = "/etc/fstabZ";
    let dst = "fstab.bck";

    let r = fs::copy(src, dst);

    match r {
        Ok(v) => println!("Copied {:?} bytes", v),
        Err(e) => println!("error copying {:?} to {:?}: {:?}", src, dst, e),
    }
}

error copying "/etc/fstabZ" to "fstab.bck": Os { code: 2, kind: NotFound, message: "No such file or directory" }


231. Test if bytes are a valid UTF-8 string

Set b to true if the byte sequence s consists entirely of valid UTF-8 character code points, false otherwise.

测试字节是否是有效的UTF-8字符串

package main

import (
 "fmt"
 "unicode/utf8"
)

func main() {
 {
  s := []byte("Hello, 世界")
  b := utf8.Valid(s)
  fmt.Println(b)
 }
 {
  s := []byte{0xff0xfe0xfd}
  b := utf8.Valid(s)
  fmt.Println(b)
 }
}

true
false

fn main() {
    {
        let bytes = [0xc30x810x720x760xc30xad0x7a];

        let b = std::str::from_utf8(&bytes).is_ok();
        println!("{}", b);
    }

    {
        let bytes = [0xc30x810x810x760xc30xad0x7a];

        let b = std::str::from_utf8(&bytes).is_ok();
        println!("{}", b);
    }
}

true
false

234. Encode bytes to base64

Assign to string s the standard base64 encoding of the byte array data, as specified by RFC 4648.

将字节编码为base64

package main

import (
 "encoding/base64"
 "fmt"
)

func main() {
 data := []byte("Hello world")
 s := base64.StdEncoding.EncodeToString(data)
 fmt.Println(s)
}

SGVsbG8gd29ybGQ=


//use base64;

fn main() {
    let d = "Hello, World!";

    let b64txt = base64::encode(d);
    println!("{}", b64txt);
}

SGVsbG8sIFdvcmxkIQ==


235. Decode base64

Assign to byte array data the bytes represented by the base64 string s, as specified by RFC 4648.

解码base64

package main

import (
 "encoding/base64"
 "fmt"
)

func main() {
 str := "SGVsbG8gd29ybGQ="

 data, err := base64.StdEncoding.DecodeString(str)
 if err != nil {
  fmt.Println("error:", err)
  return
 }

 fmt.Printf("%q\n", data)
}

"Hello world"


//use base64;

fn main() {
    let d = "SGVsbG8sIFdvcmxkIQ==";

    let bytes = base64::decode(d).unwrap();
    println!("Hex: {:x?}", bytes);
    println!("Txt: {}", std::str::from_utf8(&bytes).unwrap());
}

Hex: [48656c, 6c, 6f, 2c, 20576f, 726c, 6421]
Txt: Hello, World!

237. Xor integers

Assign to c the result of (a xor b)

异或运算

异或整数

package main

import (
 "fmt"
)

func main() {
 a, b := 23042
 c := a ^ b

 fmt.Printf("a is %12b\n", a)
 fmt.Printf("b is %12b\n", b)
 fmt.Printf("c is %12b\n", c)
 fmt.Println("c ==", c)
}

a is     11100110
b is       101010
c is     11001100
c == 204

or

package main

import (
 "fmt"
 "math/big"
)

func main() {
 a, b := big.NewInt(230), big.NewInt(42)
 c := new(big.Int)
 c.Xor(a, b)

 fmt.Printf("a is %12b\n", a)
 fmt.Printf("b is %12b\n", b)
 fmt.Printf("c is %12b\n", c)
 fmt.Println("c ==", c)
}
a is     11100110
b is       101010
c is     11001100
c == 204

fn main() {
    let a = 230;
    let b = 42;
    let c = a ^ b;

    println!("{}", c);
}

204


238. Xor byte arrays

Write in a new byte array c the xor result of byte arrays a and b.
a and b have the same size.

异或字节数组

package main

import (
 "fmt"
)

func main() {
 a, b := []byte("Hello"), []byte("world")

 c := make([]bytelen(a))
 for i := range a {
  c[i] = a[i] ^ b[i]
 }

 fmt.Printf("a is %08b\n", a)
 fmt.Printf("b is %08b\n", b)
 fmt.Printf("c is %08b\n", c)
 fmt.Println("c ==", c)
 fmt.Printf("c as string would be %q\n"string(c))
}

a is [01001000 01100101 01101100 01101100 01101111]
b is [01110111 01101111 01110010 01101100 01100100]
c is [00111111 00001010 00011110 00000000 00001011]
c == [63 10 30 0 11]
c as string would be "?\n\x1e\x00\v"

or

package main

import (
 "fmt"
)

type T [5]byte

func main() {
 var a, b T
 copy(a[:], "Hello")
 copy(b[:], "world")

 var c T
 for i := range a {
  c[i] = a[i] ^ b[i]
 }

 fmt.Printf("a is %08b\n", a)
 fmt.Printf("b is %08b\n", b)
 fmt.Printf("c is %08b\n", c)
 fmt.Println("c ==", c)
 fmt.Printf("c as string would be %q\n"string(c[:]))
}
a is [01001000 01100101 01101100 01101100 01101111]
b is [01110111 01101111 01110010 01101100 01100100]
c is [00111111 00001010 00011110 00000000 00001011]
c == [63 10 30 0 11]
c as string would be "?\n\x1e\x00\v"

fn main() {
    let a: &[u8] = "Hello".as_bytes();
    let b: &[u8] = "world".as_bytes();

    let c: Vec<_> = a.iter().zip(b).map(|(x, y)| x ^ y).collect();

    println!("{:?}", c);
}

[63, 10, 30, 0, 11]


239. Find first regular expression match

Assign to string x the first word of string s consisting of exactly 3 digits, or the empty string if no such match exists.
A word containing more digits, or 3 digits as a substring fragment, must not match.

查找第一个正则表达式匹配项

package main

import (
 "fmt"
 "regexp"
)

func main() {
 re := regexp.MustCompile(`\b\d\d\d\b`)
 for _, s := range []string{
  "",
  "12",
  "123",
  "1234",
  "I have 12 goats, 3988 otters, 224 shrimps and 456 giraffes",
  "See p.456, for word boundaries",
 } {
  x := re.FindString(s)
  fmt.Printf("%q -> %q\n", s, x)
 }
}
"" -> ""
"12" -> ""
"123" -> "123"
"1234" -> ""
"I have 12 goats, 3988 otters, 224 shrimps and 456 giraffes" -> "224"
"See p.456, for word boundaries" -> "456"

use regex::Regex;

fn main() {
    let sentences = vec![
        "",
        "12",
        "123",
        "1234",
        "I have 12 goats, 3988 otters, 224 shrimps and 456 giraffes",
        "See p.456, for word boundaries",
    ];
    for s in sentences {
        let re = Regex::new(r"\b\d\d\d\b").expect("failed to compile regex");
        let x = re.find(s).map(|x| x.as_str()).unwrap_or("");
        println!("[{}] -> [{}]", &s, &x);
    }
}

[] -> []
[12] -> []
[123] -> [123]
[1234] -> []
[I have 12 goats, 3988 otters, 224 shrimps and 456 giraffes] -> [224]
[See p.456for word boundaries] -> [456]

240. Sort 2 lists together

Lists a and b have the same length. Apply the same permutation to a and b to have them sorted based on the values of a.

将两个列表排序在一起.列表a和b的长度相同。对a和b应用相同的排列,根据a的值对它们进行排序。

package main

import (
 "fmt"
 "sort"
)

type K int
type T string

type sorter struct {
 k []K
 t []T
}

func (s *sorter) Len() int {
 return len(s.k)
}

func (s *sorter) Swap(i, j int) {
 // Swap affects 2 slices at once.
 s.k[i], s.k[j] = s.k[j], s.k[i]
 s.t[i], s.t[j] = s.t[j], s.t[i]
}

func (s *sorter) Less(i, j int) bool {
 return s.k[i] < s.k[j]
}

func main() {
 a := []K{9348}
 b := []T{"nine""three""four""eight"}

 sort.Sort(&sorter{
  k: a,
  t: b,
 })

 fmt.Println(a)
 fmt.Println(b)
}

[3 4 8 9]
[three four eight nine]

fn main() {
    let a = vec![30204010];
    let b = vec![101102103104];

    let mut tmp: Vec<_> = a.iter().zip(b).collect();
    tmp.as_mut_slice().sort_by_key(|(&x, _y)| x);
    let (aa, bb): (Vec<i32>, Vec<i32>) = tmp.into_iter().unzip();

    println!("{:?}, {:?}", aa, bb);
}

[10, 20, 30, 40], [104, 102, 101, 103]


参考资料

[1]

Rust vs Go in 2023: https://bitfieldconsulting.com/golang/rust-vs-go

本文由 mdnice 多平台发布

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/51404.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

运行时数据区

点击下方关注我&#xff0c;然后右上角点击...“设为星标”&#xff0c;就能第一时间收到更新推送啦~~~ 类文件被类装载器加载之后&#xff0c;类中的内容&#xff08;比如&#xff1a;变量、常量、方法、对象等&#xff09;这些数据需要存储起来&#xff0c;存储的位置就是在 …

RabbitMQ 教程 | 客户端开发向导

&#x1f468;&#x1f3fb;‍&#x1f4bb; 热爱摄影的程序员 &#x1f468;&#x1f3fb;‍&#x1f3a8; 喜欢编码的设计师 &#x1f9d5;&#x1f3fb; 擅长设计的剪辑师 &#x1f9d1;&#x1f3fb;‍&#x1f3eb; 一位高冷无情的编码爱好者 大家好&#xff0c;我是 DevO…

JMeter常用内置对象:vars、ctx、prev

在前文 Beanshell Sampler 与 Beanshell 断言 中&#xff0c;初步阐述了JMeter beanshell的使用&#xff0c;接下来归集整理了JMeter beanshell 中常用的内置对象及其使用。 注&#xff1a;示例使用JMeter版本为5.1 1. vars 如 API 文档 所言&#xff0c;这是定义变量的类&a…

【点云处理教程】04 Python 中的点云过滤

一、说明 这是我的“点云处理”教程的第 4 篇文章。“点云处理”教程对初学者友好&#xff0c;我们将在其中简单地介绍从数据准备到数据分割和分类的点云处理管道。 在本教程中&#xff0c;我们将学习如何使用 Open3D 在 python 中过滤点云以进行下采样和异常值去除。使用 Open…

Python将COCO格式实例分割数据集转换为YOLO格式实例分割数据集

Python将COCO格式实例分割数据集转换为YOLO格式实例分割数据集 前言相关介绍COCO格式实例分割数据集转换为YOLO格式实例分割数据集coco格式对应的json文件&#xff0c;以test.json为例格式转换代码&#xff0c;内容如下 前言 由于本人水平有限&#xff0c;难免出现错漏&#xf…

【JAVASE】什么是方法

⭐ 作者&#xff1a;小胡_不糊涂 &#x1f331; 作者主页&#xff1a;小胡_不糊涂的个人主页 &#x1f4c0; 收录专栏&#xff1a;浅谈Java &#x1f496; 持续更文&#xff0c;关注博主少走弯路&#xff0c;谢谢大家支持 &#x1f496; 方法 1. 方法概念及使用1.1 什么是方法1…

Vue『卡片拖拽式课程表』

Vue『卡片拖拽式课程表』 概述 在本篇技术博客中&#xff0c;我们将介绍一个使用Vue实现的『卡片拖拽式课程表』。这个课程表允许用户通过拖拽课程卡片来安排不同的课程在时间表上的位置。我们将逐步讲解代码实现&#xff0c;包括课程表的布局、拖拽功能的实现&#xff0c;以…

6G内存运行Llama2-Chinese-7B-chat模型

6G内存运行Llama2-Chinese-7B-chat模型 Llama2-Chinese中文社区 第一步&#xff1a; 从huggingface下载 Llama2-Chinese-7b-Chat-GGML模型放到本地的某一目录。 第二步&#xff1a; 执行python程序 git clone https://github.com/Rayrtfr/llama2-webui.gitcd llama2-web…

QtC++ 技术分析3 - IOStream

目录 iostreamscanf/printfiostream 整体架构流相关类流缓冲区 模板特化后整体结构文件流文件流对象创建常见文件流操作输出格式设定文件流状态 字符串流字符串流内部缓冲区字符串流使用 流缓冲区用户自定义 IO iostream scanf/printf 几种常见的输入输出流函数 scanf 从键盘…

操作系统4

文件管理 文件的逻辑结构 文件的目录 文件的物理结构 文件存储空间管理 文件的基本操作

【深度学习】以图搜索- 2021sota repVgg来抽取向量 + facebook的faiss的做特征检索, 从环境搭建到运行案例从0到1

文章目录 前言安装小试牛刀用repVgg抽取向量构建Faiss索引进行相似性搜索项目延伸总结 前言 Faiss的全称是Facebook AI Similarity Search。 这是一个开源库&#xff0c;针对高维空间中的海量数据&#xff0c;提供了高效且可靠的检索方法。 暴力检索耗时巨大&#xff0c;对于…

Mac下certificate verify failed: unable to get local issuer certificate

出现这个问题&#xff0c;可以安装证书 在finder中查找 Install Certificates.command找到后双击&#xff0c;或者使用其他终端打开 安装完即可

tcp三次握手python实现和结果

下载抓包工具 安装 使用1 使用2 结果 红色笔为想要发送的数据。 代码 from scapy.all import * import logginglogging.getLogger(scapy.runtime).setLevel(logging.ERROR)target_ip = 172.20.211.4 target_port = 80 data = GET / HTTP/1.0 \r\n\r\ndef start_tcp(target_…

Mac代码编辑器sublime text 4中文注册版下载

Sublime Text 4 for Mac简单实用功能强大&#xff0c;是程序员敲代码必备的代码编辑器&#xff0c;sublime text 4中文注册版支持多种编程语言&#xff0c;包括C、Java、Python、Ruby等&#xff0c;可以帮助程序员快速编写代码。Sublime Text的界面简洁、美观&#xff0c;支持多…

上传图片到腾讯云对象存储桶cos 【腾讯云对象存储桶】【cos】【el-upload】【vue3】【上传头像】【删除】

1、首先登录腾讯云官网控制台 进入对象存储页面 2、找到跨越访问CIRS设置 配置规则 点击添加规则 填写信息 3、书写代码 这里用VUE3书写 第一种用按钮出发事件形式 <template><div><input type"file" change"handleFileChange" /><…

【设计模式】详解观察者模式

文章目录 1、简介2、观察者模式简单实现抽象主题&#xff08;Subject&#xff09;具体主题&#xff08;ConcreteSubject&#xff09;抽象观察者&#xff08;Observer&#xff09;具体观察者&#xff08;ConcrereObserver&#xff09;测试&#xff1a; 观察者设计模式优缺点观察…

DataEase开源BI工具安装_数据全量_增量同步_大屏拖拽自动生成_多数据源支持_数据血缘分析---大数据工作笔记0183

我这里用的是Centos7.9安装的 可以通过uname -p来查看一下我们的电脑架构,可以看到是x86_64架构的 我们下第一个,这个是x86架构的,第二个arm架构的 然后解压到/opt/module中 然后再去重命名一下文件夹. 推荐200G 本地模式的功能比较多 推荐100G

【FPGA IP系列】FIFO的通俗理解

FPGA厂商提供了丰富的IP核&#xff0c;基础性IP核都是可以直接免费调用的&#xff0c;比如FIFO、RAM等等。 本文主要介绍FIFO的一些基础知识&#xff0c;帮助大家能够理解FIFO的基础概念。 一、FIFO介绍 FIFO全称是First In First Out&#xff0c;即先进先出。 FIFO是一个数…

C语言第十一课--------操作符的使用与分类-------基本操作

作者前言 作者介绍&#xff1a; 作者id&#xff1a;老秦包你会&#xff0c; 简单介绍&#xff1a; 喜欢学习C语言和python等编程语言&#xff0c;是一位爱分享的博主&#xff0c;有兴趣的小可爱可以来互讨 个人主页::小小页面 gitee页面:秦大大 一个爱分享的小博主 欢迎小可爱们…

7.27 作业 QT

要求&#xff1a; 结果图&#xff1a; clock.pro: QT core gui QT texttospeechgreaterThan(QT_MAJOR_VERSION, 4): QT widgetsCONFIG c11# The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated …
最新文章