<?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: M0107</title>
    <description>The latest articles on DEV Community by M0107 (@m0107).</description>
    <link>https://dev.to/m0107</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%2F1043848%2Fb7926b4f-eb04-45b3-bc2a-e18deb7e12bd.png</url>
      <title>DEV Community: M0107</title>
      <link>https://dev.to/m0107</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/m0107"/>
    <language>en</language>
    <item>
      <title>Help for C code</title>
      <dc:creator>M0107</dc:creator>
      <pubDate>Sun, 12 Mar 2023 20:03:26 +0000</pubDate>
      <link>https://dev.to/m0107/help-for-c-code-1i9j</link>
      <guid>https://dev.to/m0107/help-for-c-code-1i9j</guid>
      <description>&lt;p&gt;I just want to make a program get current cursor position then store it in array then play reverse of event with a loop and SetCursPos function i tried some codes but still could not do it here is code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;windows.h&amp;gt;


int main()
{
    POINT p;
    int arr[2];
    GetCursorPos(&amp;amp;p);
    arr[0] = p.x;
    arr[1] = p.y;

    int numPositions = sizeof(arr) / sizeof(p);
    for (int i = numPositions - 1; i &amp;gt;= 0; i--) {
        SetCursorPos(arr.[i].x, arr[i].y);
        Sleep(100);
}
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and i tried another one too :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;windows.h&amp;gt;

int main()
{
    POINT p;
    int arr[2] = {0};
    GetCursorPos(&amp;amp;p);
    arr[0] = p.x;
    arr[1] = p.y;
    int numPositions = sizeof(arr) / sizeof(int);
    for (size_t i = numPositions; i &amp;gt; 0; i--)
    {
        if (arr[i-1].x &amp;gt;= 0 &amp;amp;&amp;amp; arr[i-1].x &amp;amp;&amp;amp; (arr[i-1].y &amp;gt;= 0 &amp;amp;&amp;amp; arr[i-1].y))
    {
    SetCursorPos(arr[i-1].x, arr[i-1].y);
    Sleep(100);
    }
    }
}




&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;im confused how to do what i planned in my mind maybe there is better ways for create what i want pls help!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>c</category>
    </item>
  </channel>
</rss>
