Home Mājas » » Debates Debates

i[3] or 3[i] i [3] vai 3 [i]

Last night a while writing a very basic program in 'C' language, I came across something weird. Pēdējā nakts brītiņa rakstot pats galvenais programma "C" valoda, man nāca pāri kaut kas pārdabisks. Basically in 'C' if you want to display the value of some element in an array it is denoted as i [no. Būtībā ar "C", ja jūs vēlaties rādīt vērtība daži elements kārtībā tas ir apzīmēts kā i [no. of index], where 'i' is name of the array and in square bracket you write the index number, which u want to display. Indeksu], kur "i" ir nosaukums, kas blokā, kvadrātiekavās iekava rakstīt indeksa numuru, kas u vēlaties displeju.

The mistake I made was I wrote the index_number[name of array] ( Wrote 3[i] instead of i[3] ) and it gave the same result as it should have given, if I had written it  correctly. Šī kļūda es man rakstījusi index_number [nosaukums masīvs] (rakstītās 3 [i], nevis i [3]), un tas bija par to pašu rezultātu, kā tas būtu bijis jāsniedz, ja man bija rakstisks to pareizi. Check the screenshot shown below. Pārbaudiet screenshot redzams zemāk.

Code: Kods:

Output Output

code-output

Now I m wondering how does that happen, I mean whatever I have read about 'C' programming as yet, says i[3] is the method to access the element at 3rd index, in fact I have not ever came across any notation of the form 3[i], so what's the issue, have you ever seen this, why does this happen, any idea? Tagad man m domājām, kā tas notiktu, es domāju kāds esmu izlasījis par "C" programmas, kā vēl, saka i [3], ir metode, lai piekļūtu elements 3 indeksu, patiesībā man nav kādreiz nāca pāri jebkuru apzīmējumu, kas veidā 3 [i], lai to, kas ir jautājums, vai jūs esat kādreiz redzējuši to, kāpēc tas notiek, jebkura ideja?

If you want to download this code and see it yourself, Ja vēlaties lejupielādēt šo kodu un redzēt, tas pats, here is the file Šeit ir failu , we have uploaded it for you. , Mēs esam augšupielādējuši to you.

Tagged with: Tagged with:

Translate to EnglishÜbersetzen Sie zum Deutsch/GermanΜεταφράστε στα ελληνικά/GreekПереведите к русскому/RussianOversetter til Norsk/NorwegianÖversätta till Svensk/Swedishहिन्दी अनुवाद करने के लिए/Hindi
Tradueix al català/CatalanTulkot uz latviešu/LatvianPreložiť do slovenčiny/SlovakVertaal aan het Nederlands/Dutchترجمة الى العربية/ArabicTraduzca al Español/SpanishTraduisez au Français/French
Traduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese한국어에게 번역하십시오/Korean中文翻译/Chinese Simplified中文翻译/Chinese TraditionalПереклад на українську/Ukrainian

SMS abonētPrint This Post

Posted on 9th April 2008 by Posted par 9 aprīlis 2008 by Manav Mishra Manav Mishra , here to write articles about things which are somehow related to computers, internet (and at times, may be, to blogging as well). , Šeit rakstīt rakstus par lietām, kas ir kaut kas saistīts ar datoriem, internetā (un pie reizes, var būt, lai blogošana kā arī). He wants to make an Identity for himself, he loves, testing new softwares and services which can really help to improve the productivity of individual. All posts by Viņš vēlas, lai varētu veikt Identity par sevi, viņš mīl, testēšana jauna programmatūra un pakalpojumi, kas var patiešām palīdzēs uzlabot produktivitāti individuāliem. Visi amatu ar Manav Mishra Manav Mishra | Connect with me @ | Sazinieties ar mani @ Twitter Čivināt | | Stumble Paklupt | Need more help? | Vajadzīga palīdzība? Ask your Questions at our Jautājiet pēc mūsu Support Center Support Center

Leave your response! Atstājiet savu reakciju!

Be nice. Be nice. Keep it clean. Paturiet to tīram. Stay on topic. Palieciet uz tēmu. No spam. Nr surogātpastu.

You can use these tags: Jūs varat izmantot šos tagus:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>