<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Functions &#8211; KGG Studio</title>
	<atom:link href="https://blog.kggstudio.com/tag/functions/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.kggstudio.com</link>
	<description>개발자 테크 블로그</description>
	<lastBuildDate>Mon, 23 Mar 2026 09:21:28 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.kggstudio.com/wp-content/uploads/2025/05/cropped-K-1-32x32.png</url>
	<title>Functions &#8211; KGG Studio</title>
	<link>https://blog.kggstudio.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">244941309</site>	<item>
		<title>Rust(9) Functions</title>
		<link>https://blog.kggstudio.com/rust9-functions/</link>
					<comments>https://blog.kggstudio.com/rust9-functions/#respond</comments>
		
		<dc:creator><![CDATA[TimTam]]></dc:creator>
		<pubDate>Mon, 23 Mar 2026 09:21:28 +0000</pubDate>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Rust]]></category>
		<category><![CDATA[Functions]]></category>
		<guid isPermaLink="false">https://blog.kggstudio.com/?p=323</guid>

					<description><![CDATA[함수 형태 매개변수 타입 명시해야함. Statements and Expressions Statement: 하나의 명령줄 &#8220;let y = 6;&#8221; Expression Return 함수의 반환값은 위의 expression에서 처럼 ; 세미콜론 없이 마지막줄에 작성한다. Rust에서는 아래코드의 -> i32 와 반환타입이 i32라는것을 명시해야한다. five 함수 내의 5를 return expression 이라 한다.]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">함수 형태</h3>



<pre class="wp-block-code"><code>fn main() {
    println!("Hello, world!");

    another_function();
}

fn another_function() {
    println!("Another function.");
}</code></pre>



<p>매개변수 타입 명시해야함.</p>



<h3 class="wp-block-heading">Statements and Expressions</h3>



<p>Statement: 하나의 명령줄 &#8220;let y = 6;&#8221;</p>



<p>Expression</p>



<pre class="wp-block-code"><code>fn main() {
    let y = {
        let x = 3;
        x + 1
    };

    println!("The value of y is: {y}");
}

// 의 코드가 있는경우 아래 블럭을 expression이라 한다
{
    let x = 3;
    x + 1
}
// 여기서 evaluate 는 x+1이되고 이 값이 return이된다.</code></pre>



<h3 class="wp-block-heading">Return</h3>



<p>함수의 반환값은 위의 expression에서 처럼 ; 세미콜론 없이 마지막줄에 작성한다. </p>



<p>Rust에서는 아래코드의 -> i32 와 반환타입이 i32라는것을 명시해야한다.</p>



<pre class="wp-block-code"><code>fn five() -> i32 {
    5
}

fn main() {
    let x = five();

    println!("The value of x is: {x}");
}</code></pre>



<p>five 함수 내의 5를 return expression 이라 한다.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.kggstudio.com/rust9-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">323</post-id>	</item>
	</channel>
</rss>
