Linux Vrs Windows (For those new students).

October 9th, 2010 8:30 am by mythong

Aizawl ah hian Computer zirna atam ta hle mai a. Engchin nge an in zirtir tih chu hre vek lo mah ila, Higher chin ah Computer Science Subject pakhat anga lak theihna pawh atam ta hle mai. Tin, Private leh Government Institute pawh an kat ve ta nawk mai.

A bik in Programing lama tui tak, la zir ve tan mek School naupang leh zirlai dangah tam tak kan awm ka ring a. An tana tangkai tura ka hriat avang leh midang athiam zawk te cho chhuah nan tlem azawng ka han thai lang ve dawn teh ang. India rama Computer Science zirna School ah chuan atlangpuiin, C/C++ hi a bul tannan a hman a la  ni deuh vek a.  Kan zir hmasak ber leh an dah pawimawh tak pakhat chu a la ni reng dawn bawk ni in a lang.

Atan nan TurboC/C++, Windows platform atangin kan tan tlangpui ni in alang a. Ka rawn chhawp chhuah duh leh zirlai te (Beginner) ka kawh hmuh duh zawk chu Linux hian Windows platform atang ai chuan zir tur leh hriattur min pe thui thei zawk in ka hria. Linux Distros zingah chuan Ubuntu hi beginner te tan a an kawh hmuh hnem ber leh hriat awlsam, hman nuam ber a Proffessional tam tak ten an sawi a ni.

C/C++ programming on LINUX

C code Windows/Dos a kan ziah kha ANSI C code anih chhung chuan Linux ah pawh a la ni reng a, IDE (Turbo C/C++) kha kan hman atul tawh lo a, a aiah text editor pangai Linux in a ken engpawh kha kan hmang mai thei zawk a ni. Gedit emaw Kwrite emaw hi chu Linux install tirh ah atel ngei ngei tur a ni. Windows kan install tirha Notepad a tel ngei ang hian. Mahse, Library function pahnih conio.h leh graphic.h te hi ANSI standard an nih ve loh avangin Linux ah chuan a hman ve theih dawn loh tih hriat lawk a tha. Heng pahnih aiah hian ncurses.h/curses.h a hranpa a download a, install a ngai ve a ni.  (https://linux.softpedia.com/get/Programming/Libraries/Ncurses-6097.shtml).         C compiler kan hman tur chu Linux ah chuan GCC  a ni. ( https://en.wikipedia.org/wiki/.GNU_Compiler_Collection).

A hmasa berah chuan, Terminal han hawng la, ahnuai a mi ang hian han chhu teh:

$ gcc

gcc: no input files

gcc:no input files tih a lo lang chuan, gcc compiler install sa diam a ni tih na. “Command not found” tih ang reng a nih chuan , gcc chu package manager hmanga i install angai tih na a ni ang. Gcc compiler tih loh ah chuan C standard library glibc i neih tel ngei ngei a ngai bawk.

A hnuai a mi ang hi han chhu lut leh teh:

$  locate glibc

glibc a install chuan directory structure ” /foo/bar/glibc” tih emaw a lo lang ang. A nih loh chuan glibc install angai tih na ani ang.

Le tunah chuan gedit han hawng la, ahnuai a code hi han chhu/paste lut teh:

#include <time.h>
#include <curses.h>

int current_getch;
int doloop = 1;
static WINDOW *mainwnd;
static WINDOW *screen;
WINDOW *my_win;

int now_sec, now_min, now_hour, now_day, now_wday, now_month, now_year;
time_t now;
struct tm *now_tm;

void screen_init(void) {
   mainwnd = initscr();
   noecho();
   cbreak();
   nodelay(mainwnd, TRUE);
   refresh(); // 1)
   wrefresh(mainwnd);
   screen = newwin(13, 27, 1, 1);
   box(screen, ACS_VLINE, ACS_HLINE);
}

static void update_display(void) {
   curs_set(0);
   mvwprintw(screen,1,1,"-------- HEADER --------");
   mvwprintw(screen,3,6,"TIME: %d:%d:%d", now_hour, now_min, now_sec);
   mvwprintw(screen,5,6,"DATE: %d-%d-%d", now_day, now_month, now_year);
   mvwprintw(screen,7,6,"PRESS q TO END");
   mvwprintw(screen,10,1,"-------- FOOTER --------");
   wrefresh(screen);
   refresh();
}

void screen_end(void) {
   endwin();
}

void maketime(void) {
	// Get the current date/time
	now = time (NULL);
	now_tm = localtime (&now);
   now_sec = now_tm->tm_sec;
	now_min = now_tm->tm_min;
	now_hour = now_tm->tm_hour;
	now_day = now_tm->tm_mday;
	now_wday = now_tm->tm_wday;
	now_month = now_tm->tm_mon + 1;
	now_year = now_tm->tm_year + 1900;
}

int main(void) {
   screen_init();
   while (doloop) {
      current_getch = getch();
      if (current_getch == 113) {
         doloop = 0;
      }
      maketime();
      update_display();
      sleep(1);
   }
   screen_end();
   printf("TEST ENDS\n");
   return 0;
}

Home folder ah Directory thar siam la, tah chuan curses.c tih hmingin han save la. Terminal ah kir leh la, cd command hmangin i save na ah han lut la:

$ gcc curses.c           tih han chhu teh.

error leh bug tam tak arawn pe ang, ncurses library files i la load lo tihna a ni a.  Ncurses library files i download (tawh chuan) kha install phawt la, tichuan terminalah hetiang hian han type leh la:

$ gcc -g -Wall -l ncurses -o curses curses.c

Error engmah (a awm toh lovang) a awm tawh loh chuan ncurses library pawh a dik tawh tihna a ni a, a hnuai ami ang hian han type leh la:

$ ./curses         Output a rawn pe tawh ang. Mahse hei hi chu ncurses header file hmang ho compile dan tur ani. ncurses header file hman na ni lem lo ah chuan, gcc <filename.c> hmangin  a compile mai theih a ni.

Le C simple source code zirlai bu a arawn pek te kha, a chung a  kan sawi ang  chiah khian  han chhu leh la,gcc hmang hian han compile la, (conio.h leh graphic.h) ho hmanna erawh chu a theih ve loh tih hriat a tha. Tin, ncurses.h a thlak ngawt in awmzia a nei lo bawk.Ka sample rawn pek leh tih dan tur ka rawn sawi te khi, a tih dan awm chhun tihna a ni lo a, tin, a nih phung leh a kal hmang kim tak in ka rawn tar lang vek kher lo a, zirlai te tan in haichhuah leh tih dan kawng inkawh hmuhna mai a ni .

Similar Posts:

Recent Posts:

41 Responses to “Linux Vrs Windows (For those new students).”

  1. 1
    Zephenath Says:

    Chhiar ang..Bengvarthlak e… L1nux hi ka khawih ve nual tawh a, mahse khawih tam a ngai khawp mai.. command hriat reng a har bawk nen.. nal tur chuan hrat ve deuh a ngai.

    Desktop PC ka hman lai chuan L1nux hi ka install tel ve ziah a, Red Hat te, Fedora Core te bakah Mandrake te pawh lung an ti leng mai mai..

    Post tha tak a ni.. ka vote e.

    [Report abuse]

  2. 2
    Maisek Says:

    A lo zaphenath leh ta!

    [Report abuse]

  3. 3
    sihal Says:

    programming in c chu ka zir ve ngei kha, a bak chu ka hre lem hleilo

    [Report abuse]

  4. 4
    ^-||RaLtE||-^ Says:

    #include stdio.h
    #include conio.h
    /* greater than leh less than sign dah chuan a lang thei miah leu */
    void main()
    {
    printf(”Zephenath the 1st”);
    getch();
    }

    Output: Zephenath the 1st ve deuh ziah. :lol:

    Good post, i sample khi a awmzia hrilhfiah law law la tha tur!

    [Report abuse]

  5. 5
    Zephenath Says:

    @^-||RaLtE||-^: hahhaa Output chu leh. :) :roll:
    good simple C program.

    [Report abuse]

  6. 6
    tlau Says:

    Tha dawn khawp mai

    [Report abuse]

  7. 7
    kawlhawk Says:

    Zephenath, i f1rst dan khi a 7hing 1utuk! Ka hriat loh lam tak a ni. Han sawi ho chur2 teh u…

    [Report abuse]

  8. 8
    Zephenath Says:

    @kawlhawk: kei chu th1ng deuhin ka 1st mai tang e.. :)
    Sawi vak tur pawh a awm lo! A hrethiam leh tui mi tan a bengvarthlakin a tha e..tih mai loh chu.. ehhehee :)
    Linux khawih tirh chuan Live CD te khan kan han ti ve lauh2 a, chutah Windows atangin Hard disk partition siamin (last drive) kan han tiruak a, Linux kha kan lnstall ve thin a. Operating System 2 kan dual boot a nih chu… games khelh a nuam phian, tin, internet lamah pawh security a tha zawk. Web/network server atan LINUX a lar mah zawk..

    [Report abuse]

  9. 9
    ^-||RaLtE||-^ Says:

    @Zephenath: kawlhawka hi kan program ve dawn mi, thing a ti si che a? lol.

    [Report abuse]

  10. 10
    Zephenath Says:

    @^-||RaLtE||-^: Han program teh.. output chhuak theih hlek lo khan Error a pek loh leh Debugging hrep ngai turin aw….. :)

    [Report abuse]

  11. 11
    Vitamin_C Says:

    Ka hrethiam chiahlo mahse post tangkai tak a ni :-)

    [Report abuse]

  12. 12
    Zephenath Says:

    Vitamin_C ka ei chak e.. :lol:

    [Report abuse]

  13. 13
    CFL Says:

    Ka hul.

    [Report abuse]

  14. 14
    SeynMizo Says:

    Linux/Ubuntu… hrethiam ve nei nuaihlo. Hre ve chak viau na a, a ler atang chuan tihngaihna awm lo.

    Blogger Tutorial rawn ziak teh u. A sei/tam pawhin serial in. Google chuan hmuh tur tam mahse tuipui ral tawng hian duhlian tawng a tluk zolo(ka tan) OT thui em aw ?

    [Report abuse]

  15. 15
    ^-||RaLtE||-^ Says:

    @SeynMizo, diksawnari nen incchawp top mai rawh. NOI

    [Report abuse]

  16. 16
    SeynMizo Says:

    @15 : i blog ah lo beisei leh top mai ila ??

    Dictionary pohin a hre seng lovang. Entirnan, Blogger Template installation and Edit..etc.

    Tutorial chi hrang2 video te nen ka bei ve ngial..ka la buai tluang khawp mai. Nuam erawh ka ti phian.

    [Report abuse]

  17. 17
    ^-||RaLtE||-^ Says:

    nia, template code awm sa modify hi a then awlsam taka a theih laiin a then erawh error awm tho zel… Ka peih tak thut leh ka l,a rawn ziak ang. Ziah ka chakna leh ziah ka peih lohna ala inchen rih. lol

    [Report abuse]

  18. 18
    SeynMizo Says:

    I chakna alo pun zel theih nan……. Hriselna tha neiin lo dam zel ang che.

    [Report abuse]

  19. 19
    ^-||RaLtE||-^ Says:

    Thanks #18

    [Report abuse]

  20. 20
    chhana Says:

    Ka chhiar chhuak vek. Ka hlawkpui chai love. Thiamloh em vang!!!

    [Report abuse]

  21. 21
    funny Says:

    Linux ah pawh ubuntu hi ka ngaina ve ringawt a, a thiam phei chu ka thiam teh vaklo. hihi
    Ubuntu Generation:

    Warty Warthog
    Hoary Hedgehog
    Breezy Badger
    Dapper Drake
    Edgy Eft
    Feisty Fawn
    Gutsy Gibbon
    Hardy Heron
    Intrepid Ibex
    Jaunty Jackalope
    Karmic Koala
    Lucid Lynx

    October-a an release leh tur
    Maverick Meerkat

    An hming hi comics vela Hero ho hming ni awmtak ani :D

    [Report abuse]

  22. 22
    funny Says:

    gedit aichuan vim hi hman a nuam zawk lo maw…?

    [Report abuse]

  23. 23
    H.Vangchhia Says:

    Windows XP ka hre ve deuh :(

    [Report abuse]

  24. 24
    piu_piu Says:

    C/C++ ah hian ka la buai tawk emai keizawng..ka hul e..

    [Report abuse]

  25. 25
    Ozima Says:

    nice post, debugging pawh rawn post leh law law teh.

    [Report abuse]

  26. 26
    lalmi5ualpa Says:

    Atom tih te a awm in ka hria, linux te. Ka hriat loh em em lam a ni tlat. Sawi vak tur pawh ka hre lo. Kompiutar lamah chuan ‘html’ in tih emawni kha ka zir ve tawh a ni mai. :P ka thiam chuang hlei lova

    [Report abuse]

  27. 27
    thlanrawkpa Says:

    heichu nakin ah uluk tawkin k chhiar ag…rn bei ler mah mah em awww.. ka ti

    [Report abuse]

  28. 28
    The_Chhamanator Says:

    Informative khawp mai. A title Linux vs Windows ai chuan curses programming in Linux tih a inhmeh hmel te ka lo ti mai mai. conio.h chu Linux-a ncurses hmang thova an port na https://www.boutell.com/lsm/lsmbyid.cgi/001132 leh https://sourceforge.net/projects/linux-conioh/ ah te hian a awm.
    Turbo C graphics.h pawh kha bressenham’s algorithm vel ziah nan khan Linux ah chuan a buaithlak ve thin. Net ah chuan kual deuhva hman dan chu a awm. Chutianga buai vak kher lohva Linux-a turbo C la hman duh hram chuan dosbox khan a awlsam phian.

    [Report abuse]

  29. 29
    remruata_01 Says:

    Nia, C/C++ hi in ti lar leh lutuk maaaai…lol
    Comments tarlan rei a remlo tlats…. !!

    [Report abuse]

  30. 30
    Ozima Says:

    #29 enge i ziah thin a? hehehehe

    [Report abuse]

  31. 31
    CyberThug Says:

    @ozima #30, i tisual, ziah i tipalh. ziak tihtur… I pu muantea’n a hau lovang che maw? :D

    [Report abuse]

  32. 32
    remruata_01 Says:

    @#30 :- Ziah tur chu tam khawp mai…lolzz, Software programming nan ka hmang a.. Abikin System software lampang programmed nan te Formula translate nan te tha khups mai..

    [Report abuse]

  33. 33
    Fonz Says:

    porn film te hi ziah theih se :D a subtitle tel thlap in :D

    [Report abuse]

  34. 34
    Ozima Says:

    @CyberThug: ilo influencial phian maw ni aw ka ti hial!!! :D When in Rome do as the romans do .

    #32: good job, C/C++ pawh har tih nak lai a, fortran/pascal tih vel a code chu har leh zual awm.

    [Report abuse]

  35. 35
    chikus Says:

    Post tha tak a ni….
    Linux hi open source a nia…zir nan chuan a tha viau mahce command vel neuh2 tam ve pangai hriat tur a tam a vang erawh chuan ka ning hle kei chuan heheh….

    Windows a software install chawp ngai tam tak hi a keng tel a chu2 a thatna pa1 pawh a ni..

    Entirnan…Windows ah PhP hmanga thil i tih dawn chuan Apache Server emaw i install phawt a ngai a..ce Linux ah erawh a kengtel chutiang chu tam tak a awm a ni..

    A post tu rawn sawi ang khian C/C++ Compiler tha tak GCC pawh a kengtel nghal a…khawih peih chuan inzir nan chuan a tha khawp mai…

    Ce windows chu home use ah chuan ka la duh zawk tho2 kei chu…

    [Report abuse]

  36. 36
    K9 Says:

    hman deuh kahn ka hmang ve chhin aa buaithlak khawp mai command hriat velo chuan.

    [Report abuse]

  37. 37
    RL Says:

    Linux distro ah chuan Debian ka hmang thin shell programming tui ve lai kha chuan. Security lampangah lah a tha bawk entirnan Backtrack 4 etc. Maya particle and dynamic khawih nan a tha khawp mai windows ai chuan a crash khat deuh tih te hi kan sawi ve mai mai teh ang.

    DOS ai chuan UNIX hi a lo tha zawk khawp mai :smile:

    [Report abuse]

  38. 38
    PimPom Says:

    ^-||RaLtE||-^ hi engtinnge maw ilo hriat bik chu ni le..lolz. Kan hriat loh hretupa i ni ringawt mai.

    Tin, Post tupa pawh ititha e.

    [Report abuse]

  39. 39
    remruata_01 Says:

    A Post tu “Mythong” pawh hi programming lamah chuan a hre ril viau tih a hriat thei mai. Article i thawh tha lutuk..!!, Programming lamah hian tan i la thar teh ang u. Mi fa te tih theih ang chu kan ti ve thei tur a ni ringawt mai a ni… tan lak a ngai a ni. Nia, Linux Operating System leh Windows XP hi a fuh ber pawl a la ni rih a, ATM Machine ah pawh hian Linux leh Windows XP an hmang a, Windows Vista,Windows 7 an hmang ngailo…!!

    [Report abuse]

  40. 40
    zoho Says:

    In va ril hlawm ve aw..windows hi chu 3.1 atang khan ka lo khawih ve tawh. Prog leh language ah chuan illiterate thung. Tang teh u, naupang deuh ho kha.

    [Report abuse]

  41. 41
    sillyBoy Says:

    A bengvarthlak hle mai.

    c:\> copy con misual.txt
    Zephenath, the 1st

    Control+ Z

    Hei command hi kan zir hmasak ber. :D

    [Report abuse]

Leave a Reply

You must be logged in to post a comment.