{"id":330,"date":"2025-10-17T07:09:43","date_gmt":"2025-10-17T07:09:43","guid":{"rendered":"https:\/\/informatika.tbg.hu\/?page_id=330"},"modified":"2025-10-17T07:09:43","modified_gmt":"2025-10-17T07:09:43","slug":"bekeres-halado","status":"publish","type":"page","link":"https:\/\/informatika.tbg.hu\/index.php\/bekeres-halado\/","title":{"rendered":"Bek\u00e9r\u00e9s (halad\u00f3)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A Console.ReadLine() parancs eredm\u00e9nye teh\u00e1t mindig string.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">De hogyan tudok akkor sz\u00e1mokat beolvasni?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u00c1t kell \u0151ket alak\u00edtani. Erre val\u00f3 a Convert oszt\u00e1ly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">N\u00e9h\u00e1ny met\u00f3dus a m\u00e1r megismert adatt\u00edpusokhoz: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Convert.ToByte(), Convert.ToInt32(), Convert.ToChar(), Convert.ToDouble, &#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Megjegyz\u00e9s1: a nagy (vagy negat\u00edv) eg\u00e9sz sz\u00e1mok t\u00e1rol\u00e1s\u00e1ra haszn\u00e1ltuk az int adatt\u00edpust. Megjegyezt\u00fck, hogy 32 bites eg\u00e9sz sz\u00e1m t\u00e1rol\u00e1s\u00e1ra val\u00f3. H\u00e1t ez\u00e9rt lett az \u00e1talak\u00edt\u00f3 parancsban ToInt32.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Megjegyz\u00e9s2: minden adatt\u00edpusban k\u00fcl\u00f6n van defini\u00e1lva  .Parse() parancs, ami &#8222;beletuszkolja&#8221; abba az adatt\u00edpusba a kapott param\u00e9tert. Vagyis, a Convert.ToInt32() helyett haszn\u00e1lhatod az int.Parse() parancsot is, az egy picivel gyorsabban hajt\u00f3dik v\u00e9gre.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">N\u00e9zz\u00fck akkor konkr\u00e9t p\u00e9ld\u00e1val:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Console.WriteLine(\"Mennyi p\u00e9nzed van?);<br>int p\u00e9nz=Convert.ToInt32(Console.ReadLine());<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mi t\u00f6rt\u00e9nik itt? Ki\u00edrja a k\u00e9perny\u0151re, hogy Mennyi p\u00e9nzed van?. A k\u00f6vetkez\u0151 parancs feldolgoz\u00e1s\u00e1t jobbr\u00f3l balra kell \u00e9rtelmezni. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Beolvas a billenty\u0171zetr\u0151l az Enter lenyom\u00e1s\u00e1ig. (Console.ReadLine()). Ezt elrakja sz\u00f6vegk\u00e9nt valahova a mem\u00f3ri\u00e1ba.<\/li>\n\n\n\n<li>Ezt az adatot \u00e1talak\u00edtja eg\u00e9sz sz\u00e1mm\u00e1. (Convert.ToInt32(&#8230;))<\/li>\n\n\n\n<li>Elt\u00e1rolja p\u00e9nz n\u00e9ven.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>A Console.ReadLine() parancs eredm\u00e9nye teh\u00e1t mindig string. De hogyan tudok akkor sz\u00e1mokat beolvasni? \u00c1t kell \u0151ket alak\u00edtani. Erre val\u00f3 a Convert oszt\u00e1ly. N\u00e9h\u00e1ny met\u00f3dus a m\u00e1r megismert adatt\u00edpusokhoz: Convert.ToByte(), Convert.ToInt32(), Convert.ToChar(), Convert.ToDouble, &#8230; Megjegyz\u00e9s1: a nagy (vagy negat\u00edv) eg\u00e9sz sz\u00e1mok t\u00e1rol\u00e1s\u00e1ra haszn\u00e1ltuk az int adatt\u00edpust. Megjegyezt\u00fck, hogy 32 bites eg\u00e9sz sz\u00e1m t\u00e1rol\u00e1s\u00e1ra val\u00f3. H\u00e1t ez\u00e9rt [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-330","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/informatika.tbg.hu\/index.php\/wp-json\/wp\/v2\/pages\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/informatika.tbg.hu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/informatika.tbg.hu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/informatika.tbg.hu\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/informatika.tbg.hu\/index.php\/wp-json\/wp\/v2\/comments?post=330"}],"version-history":[{"count":1,"href":"https:\/\/informatika.tbg.hu\/index.php\/wp-json\/wp\/v2\/pages\/330\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/informatika.tbg.hu\/index.php\/wp-json\/wp\/v2\/pages\/330\/revisions\/331"}],"wp:attachment":[{"href":"https:\/\/informatika.tbg.hu\/index.php\/wp-json\/wp\/v2\/media?parent=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}