How to get turbo c to input characters from right to left

Updated on technology 2024-02-09
21 answers
  1. Anonymous users2024-02-05

    There is no way to do it natively, but it can be done programmatically.

  2. Anonymous users2024-02-04

    The single quotation marks in English are the same left and right. Do you want to type single quotation marks in Chinese? Basically, you don't need to use it.,Only when the string is output.,That is, the string in double quotes.。 In other cases, quotation marks in Chinese will be wrong.

  3. Anonymous users2024-02-03

    It's just two single quotes.,In English, there is no left and right.,Some can automatically distinguish the left and right of single quotation marks.,Some software has no difference between the left and right single quotation marks.'The effect is the same.

  4. Anonymous users2024-02-02

    The absolute value symbol is two vertical bars, this is very easy to play, press shift+|That's it, such as |a|, the function for finding absolute values in C is abs(), for example:

    #include

    main()

  5. Anonymous users2024-02-01

    If you want to call a function, you can use abs().

    If it's just to show absolute values on the screen, printf("|a|");That's it.

    Added: ||Vertical bar, shift+|The line above the carriage return, the backspace < - the key on the left, the key to the right of the plus sign, so can you find it?

    Because it is the upper gear key, it must be used in conjunction with shift.

  6. Anonymous users2024-01-31

    If you use UCDOS, you have to use it on the DOS operating system.

    XP's command-line environment is not supported.

  7. Anonymous users2024-01-30

    Please load a Chinese character support system such as UCDOS first.

  8. Anonymous users2024-01-29

    Why bother to change to VC++ to support C99

    The Express version is free and the Professional version is free for college students.

  9. Anonymous users2024-01-28

    In C, there are two ways to input and output strings:

    1 Use scanf printf input and output.

    Scanf Printf is a formatted I/O function in C that can be used for a variety of basic types of input and output, including strings (char*).

    within its support.

    The formatted character is %s.

    define char str[100];

    Enter scanf("%s",str);

    output printf("%s",str);

    The 2 C language also supports a specialized string input and output function: gets puts.

    The purpose of gets is to read in a line of input and replace the read line break with a string terminator.

    The function of puts is to output a single line of strings, that is, after the output of the string content, it will automatically add a line break at the end.

    define char str[100];

    Enter gets(str);

    output puts(str);

  10. Anonymous users2024-01-27

    In the header file, strings are used to handle function input and output, gest is used for input, and puts is used for output.

    The string input function gets, which is typed from the keyboard and ends with carriage return, is put into an array of characters and automatically adds '0''。The length of the input string should be less than the number of character array dimensions, and the string can contain spaces.

    String output function puts, output string to the display (after output, automatic line wrap, ready to use.)''Substitute'\0')。The array of characters must start with'\0'Come to an end.

    An example is as follows:

    #include

    int main()

    char str[40];

    printf("Please enter a string");

    gets(str);

    printf("Please output a string");

    puts(str);

    system("pause");

    return 0;

  11. Anonymous users2024-01-26

    1. String array input and output string:

    char s1="array";Array of characters.

    char s2[6]="array";Array length = string length + 1

    printf("%s,%c",s1,s2[2]);

    2. String pointer input and output string:

    char *sp="pointer";Character pointers.

    printf("%s,%c,%c",sp,*sp,*(sp+2));

    3. The pointer and the scanf function jointly input and output strings

    char s1[6];

    scanf("%s",s1);

    printf("%s,%c",s1,s1[2]);

    4. Pointer + array + scanf input and output string:

    char str[60], sp=str;Assign the first address str of the array to the pointer variable spscanf("%s",sp);

    printf("%s,%c,%c",sp,*sp,*(sp+3));

    printf("%s,%c,%c",str,str[0],str[3]);

    C language strings and basic components:

    1. Array: If a variable name is followed by a numeric parentheses, this declaration is an array declaration. A string is also an array.

    They end with ASCII's null as the array. It is important to note that the index value in the square brackets is calculated from 0.

    2. Pointer: If a variable is preceded by an * sign when declaring, it means that it is a pointer variable. In other words, the variable stores an address, and * (here specifically refers to the monocular operator *, the same below.)

    In the C language, there is also a binocular operator *) which is the fetch content operator, which means fetch the content stored in this memory address. Pointers are one of the main features that distinguish C from other high-level languages of its time.

    3. String: The string in the C language is actually the same as the string'\0'For char-type arrays ending in characters, you don't need to reference a library to use a glyph, but you need some functions in the C standard library to manipulate strings. They are different from arrays of characters.

    Using these functions requires referencing header files.

  12. Anonymous users2024-01-25

    In C, there are two functions that output strings:

    puts(): Directly outputs strings, and can only output strings.

    printf(): Outputs a string via the format control %s. In addition to strings, printf() can also output other types of data.

    Here's another demonstration, please see the following **:

    #include

    int main(){

    int i;

    printf("%s", str);Output via variables.

    Direct output. puts(str);Output via variables.

    Direct output. return 0;

    Result: Use %s in the printf() function

    When outputting a string, you can give the name of the array in the variable list, but you can't write it as printf("%s", str);Input of a string.

    In C, there are two functions for entering a string:

    scanf(): Enter a string via the format control character %s. In addition to strings, scanf() can also input other types of data.

    gets(): Enter a string directly, and only a string.

  13. Anonymous users2024-01-24

    You can follow the steps below:

    1 Read in. Strings, you can use scanf to read the string in %s, or you can read the whole line of character strings at once with special gets.

    2 Judgment strings. Use the strcmp function to compare it with the set string. If the input string exists in the character array cmd, when entered"test"When the program is executed, then when strcmp(str,"test"If the return value is 0, the corresponding program needs to be executed.

    3 Execution of the program.

    If you want to execute a specific function, you can call the corresponding function when the success is determined in step 2.

    If you want to execute another executable file, you can do so.

    system(exec_file_name);

    to execute the executable file. The exec file name is a string that stores the name and path of the executable file to be executed.

  14. Anonymous users2024-01-23

    I don't know how your next program works.........Even the compilation can't pass ......The return value of the scanf() function is not a string ......So the second procedure should:

    Answer: It should be changed to. i=3scanf("%s",a);

    if(strcmp(a,b)==0)

    There is also the first program.

    gets() doesn't really accept carriage returns, but it does receive spaces, and both programs ...... correctlyThere are no errors.

  15. Anonymous users2024-01-22

    scanf("%s",a),The return is an integer Bai number, you take an integer and compare it with b.

    Zhi Xing! #include""

    #include""

    main()

    void mingling(char b) can be put in front of the same as what you want from the dao! As long as you type back zhang, he will answer and execute the corresponding function!

    How not?

  16. Anonymous users2024-01-21

    It should be the problem with this copyist sentence raid i f(strcmp(scanf("%s",a),b)==0),scanf("%s"a) is 1 or 0; So the result is definitely not right.

    It's okay to write separately;

    First scanf("%s",a), then i f(a,b)==0).

  17. Anonymous users2024-01-20

    if(strcmp(scanf("%s",a),b)==0)

    Do you know what the scanf function returns? Do you know what type of parameters strcmp requires?

    Check it out!

  18. Anonymous users2024-01-19

    scanf("%s",a), that a is not followed by the address symbol &

  19. Anonymous users2024-01-18

    #include

    main()

    Bridging characters"\"The enter key is added after it, which is used to write long sentences in separate sections, and the compiler will scan it when decoding"And make the necessary conversions. */

  20. Anonymous users2024-01-17

    First of all, it's the environment, not the system!

    You're a function, it's not that it's skipped, but after you go in, you can't execute the statement inside, so there's nothing!!

  21. Anonymous users2024-01-16

    The guards of the prison, seeing that their own people were coming, ran to the side of the brocade guard to hide.

Related questions
8 answers2024-02-09

It is very difficult to use external forces to change a state of mind. >>>More

6 answers2024-02-09

You can try this method: rub it on your hair with beer and it will grow quickly! There is also a hair care effect. >>>More

5 answers2024-02-09

I think from the moment you open your eyes every day, you have to say to yourself that today is a good day, no matter what happened yesterday, after all, yesterday is the past, it can't be changed, don't let yesterday's troubles affect today's good mood, everything starts now! When you are working, no matter how busy the task is and how stressful it is, don't complain about your work, like your work, don't start the day with resentment, and you will have a sense of accomplishment to complete your work step by step! Don't compare with others, so that you will live very easily, people's biggest enemy is yourself, I think you should have heard this sentence, so, it is not interesting to compare with others, only compare with yourself, you can always have a goal, don't measure yourself by other people's standards! >>>More

13 answers2024-02-09

Unexpectedly, in this summer vacation, I am much whiter than before, and my friends are asking me. It's impossible for a while, so you have to calm down and don't pay too much attention to it. Don't go out shopping between 10 a.m. and 4 p.m., if you don't have anything too important, it's best to go out at 6 o'clock; Also, I can eat more tomatoes and cucumbers, I just eat tomatoes every day, I didn't like it very much before, but now I like it very much, {Note: >>>More

2 answers2024-02-09

Driving routes: The whole journey is about kilometres.

Starting point: Changping District. >>>More