Geri Dön

Linux işletim sistemi üzerinde C programlama dili eğitim programı

Başlık çevirisi mevcut değil.

  1. Tez No: 75611
  2. Yazar: BURCU AKTAŞ
  3. Danışmanlar: Belirtilmemiş.
  4. Tez Türü: Yüksek Lisans
  5. Konular: Mühendislik Bilimleri, Engineering Sciences
  6. Anahtar Kelimeler: Belirtilmemiş.
  7. Yıl: 1998
  8. Dil: Türkçe
  9. Üniversite: İstanbul Teknik Üniversitesi
  10. Enstitü: Fen Bilimleri Enstitüsü
  11. Ana Bilim Dalı: Matematik Mühendisliği Ana Bilim Dalı
  12. Bilim Dalı: Belirtilmemiş.
  13. Sayfa Sayısı: 250

Özet

ÖZET C programlama dili günümüzde en yaygın kullanılan çok amaçlı dillerden biridir. C, işletim sistemleri ve derleyiciler gibi kapsamlı konuların yanında basit amaçlı sayısal programlar için de kullanılabilir. C, güçlü kontrol yapılarına sahip özlü, verimli bir dildir. Hem düşük seviyeli hem de yüksek seviyeli dillere yakınlığından dolayı yazılması kolay aynı zamanda performansı yüksektir. C, modüler bir yapıya sahiptir ve bütün işletim sistemlerinde kolaylıkla çalıştırılabilir. Bu özellik programcıyı makimi bağımlılığından kurtarır. C nin üniversite bilgisayar laboratuvarlarındaki çalışmalarda sıklıkla tercih edilmesi ve yaygın olarak kullanılan LINUX işletim sistemi üzerinde C programlama dili hakkında bir yardım olanağının mevcut olmaması bu konuda bir eğitim ve yardım programı gerekliliğini doğurmuştur. Eğitim programı, LINUX işletim sistemi üzerinde XWindows altında pencerelerle çalışır. Program C ile yazılmıştır ve XWindows ortamında çalışmasını sağlayan bir takım ileri C komutları kullanılmıştır. Program menü şeklinde çalışır windows ortamının sağladığı olanaklarla fare yanında klavye de kullanarak menünün sayfaları arasında dolaşmak mümkündür. Eğitim ve yardım programı, C nin temel yapısı, kontrol cümleleri, dizi ve gösterge kullanımı, dosya giriş/çıkışı hakkında çeşitli örnekler de katarak detaylı bilgi vermektedir. Böylece dilin adım adım nasıl çalıştığı takip edilebilmektedir. Ayrıca, önişlemci ve derleyici gibi konulara da değinilmiştir. Başvuru kaynağı fonsiyonunu tamamlamak için tasarlanmış indeksden faydalınılarak istenilen başlığın menünün hangi adımlarında geçtiğini bulmak mümkündür. Verilen örnekler, ilgili konuyu içeren program ve program parçalarından oluşup, bazı programlar için kullanıcıya programı derleyip çalıştırma imkanı sunulmuşur ve çalışma mantıkları ve dikkat edilmesi gereken noktalar da belirtilmiştir.

Özet (Çeviri)

SUMMARY A TUTORIAL PROGRAM FOR C PROGRAMMING LANGUAGE ON LINUX OPERATING SYSTEM C is one of the most popular programming languages. C is a general-purpose programming language. Besides operating systems and compilers C is used in numarical programs and in file operations. C is a middle level language. Before C there were basically two types of languages. The first one, which is the symbolic representation of machine codes, is assembly language. Despite its efficiency, assembly language provides no control structures. High level languages, the second type, provide various control structures but work less efficiently. There was a need for a language which could be written more easily and at the same time provides power and efficiency of assemby language. Thus C was invented. C works on almost every operating system, although it was especially designed for UNIX. The portability property of C makes a C programmer independent of the system. C is a small, lean and flexible language yet it has powerful control structures. To be able to understand a C program, some concepts like a function, pointer, file, stream etc. must be clear. A C program is a collection of functions which makes C programs modular. A function is a subroutine which can be called by other parts of a program. A function is composed of one or more statement each of which perform an operation. In C arrays and pointers are widely used. An array is a list of variables that are all of the same type and are referenced through a common name. A pointer is a variable which holds the memory address of another variable. The C standard library contains a very rich set of file input/output functions. A file is any source from which data can be read or any destination to which it can be sent. File input and output are made through a logical interface : stream. There are two types of streams : text and binary. A text stream is used with ASCII characters. A binary stream may be used with any type of data. In Istanbul Technical University Computer Laboratories although LINUX operating system and C programming language are widely used there were no tutorial or help functions on LINUX operating system which can guide and help students and academic staff when they have problems on programming in C. In today's world it is very critical to reach the required knowledge easily and fastly. In computer world this means you must be able to reach every knowledge you want from your computer. Especially in the programming process it's very important to know every VIsmall detail and hints of the programming language used, which makes programming an arduous task. So there is a need to have a helpdesk on the computer. A successful language tutorial must be able to explain step by step how the language works and give direction to the user instead of focusing in aspects of coding. In the web pages there are various tutorials and help programs about C and C++ working on various platforms. Most of these tutorials give the general concept about the language just like a book but do not provide an interactive programming oppurtinity ( For example www.cs.yorku.ca, 143.239.1.134/92320511, www.strath.ac.uk, a Java tutorial users.neca.com/vmis etc. ). The C Tutorial and help program works under XWindows environment of LINUX operating system. With new versions of LINUX symbolic links between files, the path and contents of libraries may change. So in order to compile your C programs in the new versions LINUX you have to check these links and paths. The program works like a menu on windows which gives you the chance of using both mouse and the keyboard and the oppurtinities of the environment. The program itself is written in C using standard C code and some high-level statements for controlling XWindows environment. When the program is called a shell program works. This shell program first calls the C program menul.c which contains the main menu and the first chapter. If the user selects another chapter from the main menu, program returns the shell program and the related program is called. Every chapter is explained in a different C program which has the same number with the chapter number in the menu. The chapters can be selected in two ways : by clicking the rectangle of the chapter or entering the chapter number from the keyboard. User can abort from the program by entering zero or clicking the“Çıkış”button. Every topic in a chapter is a function in the program. According to your choice the related function is called. The strings of texts of the topic are located in the window to give coordinates. When a screen is filled, a function which place some buttons to go forward, backwards or to abort the screen is called. The function places the buttons and according to your choice, you can use either mouse or type the first letter of your choice, you can go from screen to screen. Here are some high level commands for XWindows environment : XCreateGC(display, window, 0, 0) : This command supplies the connection between the C program and the window and it can be possible to draw figures on window. XOpenDisplayC“) : This command supplies the display connection between the program and the terminal. XFreeGC(display, gc) : This command destroys the connection established with the command above. vn. XCreateSimpleWmdow(display, DefaultRootWindow(display), x, y width, height, borderwidth, colorl, color!) : This command creates a window at the (x, y) coordinate point of the screen with a width of width, height of height and border width of borderwidth.. XSetStandardProperties(display, window, name, name, None, argv, urge, &myhint): This command sets some properties of the window, as name, forecolor, backcolor etc.. XClearWindow (display, window) : This command clears the window.. XDefineCursor(display, window, curs) : This command gives the name curs to the cursor of window and the cursor gets its default shape.. XMapRaised(display,window) : This command makes window visible.. XDestroyWindow (display, window) : This command destroys the window.. XSelectInput(display, window, KeyPressMask \ ButtonPressMask...) This command specifies the input types window can accept.. XNextEvent(display, &event) : This command waits for the next event and event body is set according to the type of the event.. curs = XCreateFontCursor(display, font) : This command gives the curs the shape of font.. XDrawString(display, window, gc, x, y, string, length) : This command is included in Xlib.h header file and used to write string qflengthmth its left top corner at the (x, y) coordinate of the window.. XDrawLine(display, window, gc, xl, yl, x2, y2) : This command is included in Xlib.h header file and draws a line between (xl, yl) and ( x2, y2) coordinate points of window.. XDrawRectangle(display, window, gc, x, y, width, height) : This command is included in Xlib.h header file and used for drawing a rectangle which has got a width of width and height of height with its left top corner at the (x, y) coordinate system.. XmuDrawRoundedRectangle(display, window, gc, x, y, width, height, width y, height_y) : This command is included in Drawing.h header file and used for drawing a rectangle which has got a width of width and height of height with its left top corner at the (x, y) coordinate system and curvature of width y and heightjy.. XSetFont(display, gc,font): This command specifies the font of the given display and graphical context. VIll. XDefaultColormap(display, screen number): This command selects the deafult colors for the specified display and screen. In all menu programs three parts of code are identical : the declaration part, the function main( ) and the functions which place the forward, backward and abort buttons. Here is the code of function main( ) main (argc, argv) { mydisplay = XOpenDisplay (”“) ; myscreen = DefaultScreen (mydisplay) ; mybackground = WhitePixel (mydisplay, myscreen) / myforeground = BlackPixel (mydisplay, myscreen) ; myhint. x=20; myhint,y=30 ; myhint.width=555; myhint.height=4 05; mywindow = XCreateSimpleWindow (mydisplay, Def aultRootWindow (mydisplay), myhint. x, myhint. y, myhint. width, myhint. height, 5, myforeground, mybackground) ; XSetStandardProperties (mydisplay, mywindow, baslik, baslik, None, None, None, &myhint) ; curs=XCreateFontCursor (mydisplay, XC_hand2); XDefineCursor (mydisplay, mywindow, curs) ; mygc=XCreateGC (mydisplay, mywindow, 0,0) ; XSetBackground (mydisplay, mygc, mybackground) ; XSet Foreground (mydisplay, mygc, myforeground) ; XSelectlnput (mydisplay, mywindow, ButtonPressMask | KeyPressMask) ; XMapRaised (mydisplay, mywindow) ; XNextEvent ( mydisplay, &myevent) ; menu ( ) ; XFreeGC (mydisplay, mygc); XDestroyWindow (mydisplay, mywindow) ; XCloseDisplay (mydisplay) ; } The following code is taken from a menu in a program : void fonksiyon () { int done; sil(); IXdone=0; while (done! =2) { done=0; XDrawRectangle (mydisplay, mywindow, mygc, 8, 29, 400, 12) ; XDrawString (mydisplay, mywindow, mygc, 10, 20, ”***** FONKSİYONLAR *****“,70); XDrawString (mydisplay, mywindow,mygc, 10,40, ”1. GENEL YAPISI“,70); XDrawString (mydisplay, mywindow, mygc, 10, 54, ”0. CIKIS“,70); XDrawString (mydisplay, mywindow, mygc, 10, 96, ”SEÇİMİNİZİ YAPIN (0-3) ",70); while (done == 0) { XNextEvent ( mydisplay, &myevent) ; switch (myevent.type) { case ButtonPress: if (myevent. xbut ton. x > 8 && myevent.xbutton.x < 408 && myevent. xbut ton. y > 29 && myevent.xbut ton. y < 41) { secim= ' 1 ' ; done=l ; } break; case KeyPress: i=XLookupString ( Smyevent, text, 10, &mykey, 0 ) ; if (i - 1 && text[0] == '0') {secim='0'; done=2;} if (i == 1 && text[0] == '1') {secim='l'; done=l;} if (i == 1 && ((text[0] == 'r') || (text[0] = lR'))) {secim='r'; done=l;} break; } }switch (secim) { case ' 1 ' : f onk_yapi ( ) ; break; case * 0' : sil(); } } } The XDrawRectangle command draws a rectangle and XDrawString writes a string in the rectangle. The XNextEvent command accepts both key strokes and mouse clicks. The C tutorial program includes the topics : C fundamemtals, control statements, arrays, pointers, functions, file input/output, structures and unions. For almost every topic there are various examples which are composed of programs or parts of programs. In some pages there is a button for the user to compile and run the program. The flow logic and some hints on these example programs are explained following the programs. XI

Benzer Tezler

  1. Sanal ortamda eğitim görselyöre sunucusunda kayıt, izleme ve sınav program paketi

    Registration, performance grading and examination program package in distance education through internet web site server

    MEHMET ALPER TUNGA

    Yüksek Lisans

    Türkçe

    Türkçe

    1999

    Mühendislik Bilimleriİstanbul Teknik Üniversitesi

    PROF.DR. METİN DEMİRALP

  2. İnternet tabanlı uzaktan eğitim sistemi geliştirilmesi: Öğrenme modüllerinin oluşturulmasında robert gagne'nin öğrenme adımlarının kullanılması

    The development of internet based distance education system: Using robert gagne's nine events to create learning modules

    ALİ GÖKDEMİR

    Yüksek Lisans

    Türkçe

    Türkçe

    2009

    Eğitim ve ÖğretimZonguldak Karaelmas Üniversitesi

    Eğitim Bilimleri Bölümü

    YRD. DOÇ. DR. ÖMÜR AKDEMİR

  3. Nesneye dayalı video sorgulama sistemi

    An Object oriented video query system

    OĞUZHAN ÖZTAŞ

    Doktora

    Türkçe

    Türkçe

    2001

    Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrolİstanbul Üniversitesi

    Bilgisayar Mühendisliği Ana Bilim Dalı

    PROF. DR. İLHAMİ YAVUZ

    PROF. DR. MİTHAT UYSAL

    DOÇ. DR. CEM PARMAKSIZOĞLU

  4. Linux işletim sistemi üzerinde bileşen tabanlı yazılım geliştirmeye olanak sağlayan bir sistemin tasarımı ve gerçekleştirimi

    Design and implementation of a system that enables development of component based software on linux operating system

    EMİR ÜNER

    Yüksek Lisans

    Türkçe

    Türkçe

    2002

    Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve KontrolHacettepe Üniversitesi

    Bilgisayar Mühendisliği Ana Bilim Dalı

    PROF. DR. ERSİN TÖRECİ