FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Many built-in input / output functions are provided in C language

     

    Many built-in input and output functions are provided in the C language. Standard file definition All devices will be processed in the C language. In order to access the keyboard and screen, the following three files open when the program is executed. The input / output in the C language typically uses the built-in Printf () and scanf () functions. The scanf () function is used to read and format from the standard input (keyboard), and the Printf () function sends a formatted output to the standard output (screen). #include // Execute the Printf () function requires the library INTMAIN () {Printf ("STM32"); // Displays the content RETURN0 in quotes; } Compile the above programs, the output results are: STM32 Analysis: The main () function needs to be included in the C language program. The code starts from the main () function. Printf () is used to format the output to the screen. The Printf () function is declared in the "stdio.h" header file. Stdio.h is a header file (standard input output header file) and # include is a pre-processing command to introduce header files. When the compiler encounters a Printf () function, if the stdio.h header file is not found, compiling errors will occur. RETURN 0; the statement is used to represent the exit program. % D formatted output integer Compile the above programs, the output results are: Number = 5 Use "% D" (integer) in quotation marks in the printf () function to match the integer variable Testinteger and output to the screen. % F formatted output floating point data #include INTMAIN () {floatf; Printf ("Enter a Number:"); //% F matches floating point data scanf ("% f", & f); Printf ("Value =% f", f); Return0; } GetChar () and PUTCHAR () functions The INT PUTCHAR (INT C) function outputs the character to the screen and returns the same character. This function will only output a single character in the same time. You can use this method in a loop to output multiple characters on the screen. The int getchar (void) function reads the next available characters from the screen and returns it to an integer. This function will only read a single character in the same time. You can use this method in a loop to read multiple characters from the screen. Look at the following example: The above code is compiled and executed, it will wait for you to enter some text, when you enter a text and press Enter, the program will continue and only read a single character, as follows: $. / a.ounsenter a value: Runoobyou Entered: R Gets () and PUTS () functions The char * GETS (CHAR * S) function reads a row to the buffer pointed to S, until a terminator or EOF. INT PUTS (Const Char * S) function writes string s and a trailing liner in STDOUT. Run as follows: $. / a.ounsenter a value: runoobyou entered: RunoB Scanf () and Printf () functions INT scanf (const char * format, ...) function Reads input from standard input stream stdin and browses the input according to the Format provided. The int printf (const char * format, ...) function writes the output to the standard output stream stdout and generates an output based on the provided format. Format can be a simple constant string, but you can specify% S,% D,% C,% F or the like to output or read strings, integers, characters, or floating point numbers, respectively. There are many other available format options that can be used as needed. For complete details, you can view the reference manual for these functions. Now let's deepen understanding through the simple instances below: Run is shown below: $. / a.ounsenter a value: RunoB 123you entered: RunoB 123 It is worth noting that the format of Scanf () looks forward is the same as the% s and% D you given, which means you have to provide effective input, such as "string integer, if you provide" string string "or "Integer Integer", it will be considered an incorrect input. In addition, when reading a string, as long as you encounter a space, scanf () will stop reading, so "this is test" is three strings for scanf (). , Read the full article, original title: Input & output in C language Article Source: [Micro Signal: C-STM32, WeChat public number: STM32 embedded development] Welcome to add attention! Please indicate the source of the article.

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us