묻고 답해요
156만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨우아한 고성능 프로그래밍 언어 Rust 입문 및 활용
Integer는 자동으로 copy되서(copy type)(integer 는 stack에 할당되서)
예문을Integer먼저 넣고 두번째 변수는 String 이게 더 좋지 않을까요? 출처 https://www.reddit.com/r/rust/comments/up1yhg/rust_ownership_for_integer_vs_string_literals/What’s going on under the covers is that when a variable who’s type has a constant length (like an integer) gets passed to a function, rust allocates space on the call stack for that variable and copies it’s value into the function’s call stack. Thus the instance of X that your function gets is different (is at a different memory address) than the copy of X that was passed to it. For strings, the compiler doesn’t know how much space to allocate (because the function could be called with your constant length string or any other string).
-
해결됨우아한 고성능 프로그래밍 언어 Rust 입문 및 활용
명령어를 입력 한 후 source "$HOME/.cargo/env" 이 명령어를 입력해야 합니다.
명령어를 입력 한 후 source "$HOME/.cargo/env" 이 명령어를 입력해야 합니다. 해당 설명이 누락되어 있는 것 같아서요.! 참고로 저는 m1 입니다!