묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨우아한 고성능 프로그래밍 언어 Rust 입문 및 활용
임대값의 수명에 대한 강의는 언제쯤 볼 수 있을까요?
섹션7에 제네릭, 트레이트 강의는 있는데 임대값의 수명 강의는 아직 없는 것 같습니다. 언제쯤 볼 수 있을지 궁금합니다.
-
해결됨우아한 고성능 프로그래밍 언어 Rust 입문 및 활용
문자열 리터럴이 너무 어려워요ㅠㅠ
문자열 리터럴이 뭘 뜻하는지 잘 모르겠어요.리터럴이 말 그대로 데이터 값 그 자체라고 생각했는데요 (ex 2, 4, "hello") 그런데 강의 중 "문자열 리터럴이 특정 영역에 있는 문자열 데이터를 참조하고 있는 값"이라고 설명하셔서 혼란스러워요.그럼 문자열 리터럴은 결국 문자열을 가리키고 있는 포인터인가요?let hello: &str = "hello" 그리고 "문자열 리터럴이 특정 영역에 있는 문자열 데이터를 참조하고 있는 값" -> 여기서 특정 영역은 data 영역을 말하는 것일까요?리터럴이라는 용어 자체가 그냥 데이터 값이라고 알고 있었는데, 리터럴이 참조 값이었고 타입은 문자열 슬라이스 타입이어서 헷갈려요ㅠㅠ 도와주세요
-
해결됨우아한 고성능 프로그래밍 언어 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 입니다!