<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Forum Pasja Informatyki - Najnowsze z tagiem #błąd-w-kodzie</title>
<link>https://forum.pasja-informatyki.pl/tag/%23b%C5%82%C4%85d-w-kodzie</link>
<description>Powered by Question2Answer</description>
<item>
<title>Problem z getch()</title>
<link>https://forum.pasja-informatyki.pl/216823/problem-z-getch</link>
<description>

&lt;pre class=&quot;brush:cpp;&quot;&gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;time.h&amp;gt;
#include &amp;lt;cstdlib&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;windows.h&amp;gt;
#include &amp;lt;conio.h&amp;gt;

using namespace std;

int war1,war2;
float x,y;
char wybor;
char prze;

int main()
{
    cout &amp;lt;&amp;lt; &quot;Witaj w aplikacji przelicznik&quot;&amp;lt;&amp;lt;endl;

    cout &amp;lt;&amp;lt; &quot;Co chcesz przeliczyć&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; endl;
     cout &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;      MENU &quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;--------------------&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;1. Masa&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;2. Dlugość&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;3. Czas&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;4. Wyjście&quot; &amp;lt;&amp;lt; endl
     wybor=getch();    ////////Jakiś błąd//////////////
     system(&quot;cls&quot;);
    switch (wybor)
    {
        case '1':
        {
    cout &amp;lt;&amp;lt; &quot;Z jakiej jednostki chcesz przeliczać&quot; &amp;lt;&amp;lt; endl;
            cout &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;MENU PRZELICZNIKA MAS&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;---------------------&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;1. Gramy&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;2. Dekagramy&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;3. Kilogramy&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;4. Tony&quot; &amp;lt;&amp;lt; endl;
    cin &amp;gt;&amp;gt; war1;
    cout &amp;lt;&amp;lt; &quot;podaj wartość&quot;
    cin &amp;gt;&amp;gt; x; ////błąd////
    system(&quot;cls&quot;);
  
    cout &amp;lt;&amp;lt; &quot;Na co chcesz przeliczać&quot; &amp;lt;&amp;lt; endl;
            cout &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;MENU PRZELICZNIKA MAS&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;---------------------&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;1. Gramy&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;2. Dekagramy&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;3. Kilogramy&quot; &amp;lt;&amp;lt; endl;
    cout &amp;lt;&amp;lt; &quot;4. Tony&quot; &amp;lt;&amp;lt; endl;
    prze=getchar()
    cout &amp;lt;&amp;lt; &quot;Podaj wartość:&quot;; ////błąd////
    cin &amp;gt;&amp;gt; y;
    system(&quot;cls&quot;);
       }
       break;
    }
    return 0;
}
&lt;/pre&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;



&lt;p&gt;Witam mam drobny problem. Wpadłem na pomysł zrobienia swojej pierwszej aplikacji własnoręcznej która miała by przeliczać miary długości,masy i czasu ale niestety z niewiadomych mi przyczyn nie działa mi funkcja getch(). Co ciekawe zastosowałem taką samą kolejność i pisałem znak w znak to samo co w innej aplikacji co miała tą funkcje i nie działa . Proszę o szybką odpowiedź z góry dziękuje.&lt;/p&gt;



&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<category>C i C++</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/216823/problem-z-getch</guid>
<pubDate>Mon, 16 Jan 2017 16:28:40 +0000</pubDate>
</item>
</channel>
</rss>