<?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>memory Archives - Huahua&#039;s Tech Road</title>
	<atom:link href="https://zxi.mytechroad.com/blog/tag/memory/feed/" rel="self" type="application/rss+xml" />
	<link>https://zxi.mytechroad.com/blog/tag/memory/</link>
	<description></description>
	<lastBuildDate>Sat, 18 Jul 2020 01:00:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.8</generator>

<image>
	<url>https://zxi.mytechroad.com/blog/wp-content/uploads/2017/09/cropped-photo-32x32.jpg</url>
	<title>memory Archives - Huahua&#039;s Tech Road</title>
	<link>https://zxi.mytechroad.com/blog/tag/memory/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Why grid[y][x] instead of grid[x][y]?</title>
		<link>https://zxi.mytechroad.com/blog/cs/why-gridyx-instead-of-gridxy/</link>
					<comments>https://zxi.mytechroad.com/blog/cs/why-gridyx-instead-of-gridxy/#respond</comments>
		
		<dc:creator><![CDATA[zxi]]></dc:creator>
		<pubDate>Sat, 18 Jul 2020 00:59:50 +0000</pubDate>
				<category><![CDATA[CS]]></category>
		<category><![CDATA[column major]]></category>
		<category><![CDATA[cs]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[row major]]></category>
		<guid isPermaLink="false">https://zxi.mytechroad.com/blog/?p=7111</guid>

					<description><![CDATA[<p>If you don&#8217;t like grid[y][x], you can use grid[r][c] instead. [crayon-6638cf473030f812605925/]</p>
<p>The post <a rel="nofollow" href="https://zxi.mytechroad.com/blog/cs/why-gridyx-instead-of-gridxy/">Why grid[y][x] instead of grid[x][y]?</a> appeared first on <a rel="nofollow" href="https://zxi.mytechroad.com/blog">Huahua&#039;s Tech Road</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Why grid[y][x] instead of grid[x][y]? - CS大讲堂 EP16" width="500" height="281" src="https://www.youtube.com/embed/P50r4CDeUYw?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></figure>



<figure class="wp-block-image size-large"><img width="960" height="540" src="https://zxi.mytechroad.com/blog/wp-content/uploads/2020/07/grid_y_x-ep16-1.png" alt="" class="wp-image-7112" srcset="https://zxi.mytechroad.com/blog/wp-content/uploads/2020/07/grid_y_x-ep16-1.png 960w, https://zxi.mytechroad.com/blog/wp-content/uploads/2020/07/grid_y_x-ep16-1-300x169.png 300w, https://zxi.mytechroad.com/blog/wp-content/uploads/2020/07/grid_y_x-ep16-1-768x432.png 768w" sizes="(max-width: 960px) 100vw, 960px" /></figure>



<figure class="wp-block-image size-large"><img width="960" height="540" src="https://zxi.mytechroad.com/blog/wp-content/uploads/2020/07/grid_y_x-ep16-2.png" alt="" class="wp-image-7113" srcset="https://zxi.mytechroad.com/blog/wp-content/uploads/2020/07/grid_y_x-ep16-2.png 960w, https://zxi.mytechroad.com/blog/wp-content/uploads/2020/07/grid_y_x-ep16-2-300x169.png 300w, https://zxi.mytechroad.com/blog/wp-content/uploads/2020/07/grid_y_x-ep16-2-768x432.png 768w" sizes="(max-width: 960px) 100vw, 960px" /></figure>



<p>If you don&#8217;t like grid[y][x], you can use grid[r][c] instead.</p>



<div class="responsive-tabs">
<h2 class="tabtitle">C++</h2>
<div class="tabcontent">

<pre class="crayon-plain-tag">#include &lt;iostream&gt;

using namespace std;

int main(int argc, char** argv) {
  constexpr int kRows = 2;
  constexpr int kCols = 3;
  int arr[kRows][kCols] = {{1,2,3},{4,5,6}};
  for (int r = 0; r &lt; kRows; ++r) {
    for (int c = 0; c &lt; kCols; ++c)
      cout &lt;&lt; arr[r][c] &lt;&lt; &quot; &quot;;
    cout &lt;&lt; endl;
  }

  for (int r = 0; r &lt; kRows; ++r)
    for (int c = 0; c &lt; kCols; ++c)
      cout &lt;&lt; &amp;(arr[r][c]) - &amp;(arr[0][0]) &lt;&lt; &quot; &quot;;
  return 0;
}

// Output:
// 1 2 3
// 4 5 6
// 0 1 2 3 4 5</pre>
</div></div>
<p>The post <a rel="nofollow" href="https://zxi.mytechroad.com/blog/cs/why-gridyx-instead-of-gridxy/">Why grid[y][x] instead of grid[x][y]?</a> appeared first on <a rel="nofollow" href="https://zxi.mytechroad.com/blog">Huahua&#039;s Tech Road</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://zxi.mytechroad.com/blog/cs/why-gridyx-instead-of-gridxy/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
