<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: A Curious Learner</title>
    <description>The latest articles on DEV Community by A Curious Learner (@a_curious_learner).</description>
    <link>https://dev.to/a_curious_learner</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1123925%2Fbf435b8c-0c94-4dcd-b9cf-5953b7862938.jpg</url>
      <title>DEV Community: A Curious Learner</title>
      <link>https://dev.to/a_curious_learner</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/a_curious_learner"/>
    <language>en</language>
    <item>
      <title>Solve the error: redefinition of</title>
      <dc:creator>A Curious Learner</dc:creator>
      <pubDate>Fri, 21 Jul 2023 08:12:46 +0000</pubDate>
      <link>https://dev.to/a_curious_learner/solve-the-error-redefinition-of-8kj</link>
      <guid>https://dev.to/a_curious_learner/solve-the-error-redefinition-of-8kj</guid>
      <description>&lt;p&gt;Suppose we have such a segment of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a[2];
int i=1;
for(int i=0;i&amp;lt;2;i++){
  a[i]=i;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When we compile and write a piece of code, the compiler may successfully compile the program, or it may display an error message: redefinition of "i".&lt;br&gt;
The situation depends on the type of compiler. Some compilers allow redefining a variable with the same name within a block of code enclosed in curly brackets. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int i=1;
if(true){
  int i=3;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, the variable i is defined twice, the second time we define i in the if block. But the compiler will still compile the program successfully, because this kind of compiler allows redefinition of variables in a segment of code inside the curly brackets, and the i inside the braces is invisible to the code outside the curly brackets, that is, the value of i outside the braces is still 1 instead of 3.&lt;br&gt;
However, in the case of bad luck, some compilers will not allow us to redefine a variable that has already been defined in a for loop.&lt;/p&gt;

</description>
      <category>c</category>
      <category>cpp</category>
    </item>
    <item>
      <title>Attention please: The symbol for exponentiation is not ^!</title>
      <dc:creator>A Curious Learner</dc:creator>
      <pubDate>Fri, 21 Jul 2023 08:03:55 +0000</pubDate>
      <link>https://dev.to/a_curious_learner/attention-please-the-symbol-for-exponentiation-is-not--4pd8</link>
      <guid>https://dev.to/a_curious_learner/attention-please-the-symbol-for-exponentiation-is-not--4pd8</guid>
      <description>&lt;p&gt;When I first used a C program to calculate powers, I used the "^" symbol. &lt;br&gt;
But the way to calculate a power is to call the &lt;code&gt;pow()&lt;/code&gt;function. "^" is bitwise exclusive OR operator in C.&lt;br&gt;
Here is the usage of &lt;code&gt;pow()&lt;/code&gt; function: pow(2,3)=2*2*2=8.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>c</category>
    </item>
    <item>
      <title>Solve the error "header files not found. no such file or directory".</title>
      <dc:creator>A Curious Learner</dc:creator>
      <pubDate>Fri, 21 Jul 2023 07:26:44 +0000</pubDate>
      <link>https://dev.to/a_curious_learner/solve-the-error-header-files-not-found-no-such-file-or-directory-4pe3</link>
      <guid>https://dev.to/a_curious_learner/solve-the-error-header-files-not-found-no-such-file-or-directory-4pe3</guid>
      <description>&lt;p&gt;When we write a C/C++ program, we often need to use third-party header files (that is, unofficial header files different from stdio.h).&lt;br&gt;
We need to use &lt;code&gt;#include&lt;/code&gt; to include the header files to be used, and then compile the program. If the compiler displays an error message: header files not found. no such file or directory, how to solve this error?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PYOCPIag--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2e8mwvz8hbp7xsth5koz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PYOCPIag--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2e8mwvz8hbp7xsth5koz.png" alt="header files not found" width="759" height="740"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since the compiler tells us it can't find the file, we need to know where the compiler looks for the header file.&lt;br&gt;
The compiler will first look for the header file in the folder where the source program is located. If there is no header file in this folder, the compiler will look for it in the default include folder (the default include folder is usually near the folder where the compiler program is located).&lt;br&gt;
If the compiler still cannot find the header file in the include folder, then you need to manually set the path of the header file so that the compiler can find the header file according to the path.&lt;/p&gt;

</description>
      <category>c</category>
      <category>cpp</category>
      <category>header</category>
    </item>
  </channel>
</rss>
