How to start learning C programming in the Turbo C ++ IDE

Author: Janice Evans
Date Of Creation: 28 July 2021
Update Date: 23 June 2024
Anonim
How Start Programming with C Language + Turbo C++ IDE
Video: How Start Programming with C Language + Turbo C++ IDE

Content

C is one of the oldest and most powerful programming languages, developed in the 1970s by Dennis Ritchie.However, if you learn to program in C, then other languages ​​will not be too difficult for you. This article can help you get started learning the C programming language using the "Turbo C ++ IDE" compiler.

Steps

  1. 1 Download Turbo C ++ IDE to your operating system.
    • Turbo C ++ may not work in Windows Vista and Windows 7. You may need to run the compiler in the “DosBox” program.
    • Install DOSBox software with version 0.74
    • Create a folder, for example “Turbo” (C: Turbo ):
    • Download and unzip TC into Turbo folder (c: Turbo ):
    • Start DOSBox 0.74 by clicking on the desktop icon:
    • Write the following commands on the command line [Z]:
    • mount d c: Turbo [TC folder is inside Turbo folder]
    • Now, you should see the message: Drive D is mounted as a local directory C: Turbo
    • Write d: to go to section d:
    • Next, follow these commands:
    • cd tc
      cd bin
      tc or tc.exe

      [This will start Turbo C ++ 3.0]
    • In Turbo C ++ go to Options> Directories> Change TC source to source [D] folder (for example, virtual D: refers to C: Turbo . So change the path to something like D: TC include and D: TC lib, respectively)
    • You can save time by letting DOSBox automatically load your folders and run TurboC ++:
    • For DOSBox versions higher than 0.74 - open the dosbox.conf file in the program installation directory using any text editor. For version 0.73, go to the Start menu and click on “Configuration” and then on “Edit Configuration”. Scroll down to the bottom of the document and add lines that will automatically start when DOSBox starts up.
  2. 2 Once you install the Turbo C ++ compiler, learn about the features #include, printf (Printf is used to print messages to the console) and scanf (Scanf is used to scan messages from the console to memory).
  3. 3 Create a simple script Hello world and run it. Congratulations, you've started learning C in the Turbo C ++ IDE!
  4. 4 Remember: C is a high level programming language (HLL). It is case sensitive, modular and structured.
  5. 5 Learn about keywords. These are predefined words reserved by the programming language. Each keyword has a specific function. You will not be able to use keywords for other purposes.
    • There are 32 keywords in the C language.
    • Each word is case sensitive.
    • The keyword cannot be an identifier, variable, or function.
    • Examples of keywords: void, if, else, do.
  6. 6 Learn about variables. Variables are the names of blocks of memory that will store program values. To use variables, the programmer needs to label them.
  7. 7 Datatype (Data Types): They indicate the type of value represented by a particular variable. Below are the 4 most common and important data types; their formatting operator is indicated on the right side.
    • int ->% d
    • float ->% f
    • char ->% c
    • double ->% f (Yes, float & double have the same formatting operator)
    • Strings are part of char, but the formatting operator for strings is% s
  8. 8 Learn about arithmetic operators, logical operators, increment / decrement operators, conditional operators, flow control structure (if-else, if statement, nested if) and loops (while, do-while, for).
  9. 9 Learn about arrays and sorts.
  10. 10 Learn about ASCII (American Standard Coding Table for Printable Characters and Some Special Codes). ASCII is sometimes used in C programming.
  11. 11 Learn about pointers.
  12. 12 Start with simple and small programs and work your way up to more complex tasks.
  13. 13 Sign up for specialized courses to improve your C. Read books about C programming.
    • Remember, you cannot learn a programming language without a certain investment of time and effort.

Sample Hello World Program

# includestdio.h> void main () {clrscr (); printf ("Hello World"); }

Tips

  • Once your code is ready, save your *. Exe file.
  • Learn to debug programs.
  • If you are having trouble fixing your syntax error, try searching Google or other search engines. You can easily find people who can help you.
  • If you find a bug, please tell others about it. Don't hide it.Mistakes are the first step in learning a programming language.