CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

Author: juwaini

Mari Bermain Dengan C++

[Copy link]
Post time 17-12-2007 07:28 AM | Show all posts
Originally posted by i212 at 15-12-2007 12:47 AM
contoh penggunaan C++/C......

masa bukak PC.. korang punya Bios program tuh merupakan embeded program..
selalunya embeded program nih menggunakan C/c++.....


lets stick to C++ lah.
Reply

Use magic Report


ADVERTISEMENT


Post time 17-12-2007 07:32 AM | Show all posts
Originally posted by ultra78 at 14-12-2007 04:18 PM


aku dulu ada belajar prolog..peghh..buat program dalam komputer sampai kita boleh 'bercakap' dengan komputer tu..


#include <iostream>

int main()
{
    std::cout << "Assalamualaikum Ultra.\n";
    return 0;
}

Korang cakap pasal apa?
Reply

Use magic Report

Post time 17-12-2007 07:36 AM | Show all posts
Originally posted by juwaini at 14-12-2007 12:57 AM


abang pelaga cukup pandai bikin lawak..
ana mau gelak sampai pagi esok..

compiler itu bukannya urang.. tapi compiler itu adalah sesuatu yang akan mengaktifkan prugram tersebut..
abang pelaga bulih google "c++ compiler"..
...


Ente bagitau la macamana sebenarnya nak cakap 'Assalamualaikum!' dlm C++. Nak bagi salam pun tabley, mcm mana nak main?
Reply

Use magic Report

 Author| Post time 19-12-2007 12:49 AM | Show all posts
Originally posted by pelaga at 17-12-2007 07:26 AM
#include

int main()
{
    std::cout  


ente falaga patut belajar fasal sintaks dulu.. dalam masa yang samaaaa... jangan lupa berfikir tentang algoritma..
Reply

Use magic Report

 Author| Post time 19-12-2007 12:52 AM | Show all posts

  1. #include <iostream>

  2. using namespace std;

  3. void main()
  4. {
  5.     cout << "\nAssalamualaikum pelaga. apa khabar ente? ";
  6. }
Copy the Code


program berikut ditulis di atas visual c++ 6.0..
Reply

Use magic Report

Post time 19-12-2007 03:23 AM | Show all posts
tabley buat dlm words aje ka? Homepage ana buat dlm words boleh je.
Reply

Use magic Report

Follow Us
 Author| Post time 19-12-2007 08:42 AM | Show all posts
Originally posted by pelaga at 19-12-2007 03:23 AM
tabley buat dlm words aje ka? Homepage ana buat dlm words boleh je.



http://www.bloodshed.net/download.html

abang felaga, ente bulih daunlud di link tersubut..
Reply

Use magic Report

Post time 19-12-2007 12:29 PM | Show all posts
Originally posted by ultra78 at 14-12-2007 07:51 AM
kalau mcm ni jadi apa?

Programming C memang best sangat tapi bila masuk part loops jer aku memang slalu fail
Sebab kepala otak aku macam susah nak proses apa output yang kuar.. kalo nak jawap soklan camni biasanya aku lukis dulu bintang2 tu, tgk brapa yang masuk, brapa yang kuar.. baru dapat jawapan
Reply

Use magic Report


ADVERTISEMENT


 Author| Post time 19-12-2007 02:00 PM | Show all posts
Originally posted by Zep at 19-12-2007 12:29 PM

Programming C memang best sangat tapi bila masuk part loops jer aku memang slalu fail
Sebab kepala otak aku macam susah nak proses apa output yang kuar.. kalo nak jawap soklan ...


actually, that's the best way..
Reply

Use magic Report

Post time 21-12-2007 05:29 PM | Show all posts
Originally posted by Zep at 19-12-2007 12:29 PM

Programming C memang best sangat tapi bila masuk part loops jer aku memang slalu fail
Sebab kepala otak aku macam susah nak proses apa output yang kuar.. kalo nak jawap soklan ...


bab loop tu ok lagi lar...tapi bila masuk bab pointer,kena lebih 'imaginasi' sikit.aku pun struggle bab ni..
mujurlah java takde menda ni..

aku pun nak refresh balik


  int a, *b;
  b = &a;

b adalah integer pointer . (b=&a) sebenarnya passing address variable a (bukan value) kepada pointer b.
bukan setakat variable ada pointer, pointer kepada function pun ada..

[ Last edited by  ultra78 at 21-12-2007 05:30 PM ]
Reply

Use magic Report

 Author| Post time 21-12-2007 06:35 PM | Show all posts
Originally posted by ultra78 at 21-12-2007 05:29 PM


bab loop tu ok lagi lar...tapi bila masuk bab pointer,kena lebih 'imaginasi' sikit.aku pun struggle bab ni..
mujurlah java takde menda ni..

aku pun nak refresh balik


  int a, * ...


ish ko ni.. dah masuk bab pointer la plak.. orang lain semua dok merangkak2 lagi ni..
btw, aku rasa ada sikit kesilapan dalam code ko..
aku RASA patutnya gini :

  1. int i = 5;
  2. int *iPtr = &i;
Copy the Code


rasanya yang ni baru betul kot..
pointer ni berguna untuk projek besar2 yang kita nak jaga memori aje..
projek kecik2 ni, pakai array baru pun takpe..
Reply

Use magic Report

Post time 22-12-2007 12:49 AM | Show all posts

Reply #71 juwaini's post

**p = pointer kepada pointer
Reply

Use magic Report

 Author| Post time 22-12-2007 01:24 AM | Show all posts
Originally posted by ultra78 at 22-12-2007 12:49 AM
**p = pointer kepada pointer

serius ke memain ni?
Reply

Use magic Report

Post time 27-12-2007 04:52 PM | Show all posts
Originally posted by Zep at 19-12-2007 12:29 PM

Programming C memang best sangat tapi bila masuk part loops jer aku memang slalu fail
Sebab kepala otak aku macam susah nak proses apa output yang kuar.. kalo nak jawap soklan ...



samela kite..ahahahhaha...
Reply

Use magic Report

Post time 1-1-2008 04:15 PM | Show all posts
aku dulu belajar C++ guna TC Lite.. simple............. blue screen
Reply

Use magic Report

Post time 4-1-2008 04:46 PM | Show all posts
apo kata korang letak code yang leh buat benda seperti dibawah...


*****
****
***
**
*

dan

          *
         **
        ***
       ****
        ***
         **
          *
Reply

Use magic Report


ADVERTISEMENT


Post time 4-1-2008 10:27 PM | Show all posts

yg fes..

cin>>totalline;

int totalstar;

for(int i=totalline;i>0;i--)
{
   totalstar = i;
    for (j=1; j <= totalstar;j++)
   {
         cout<<"*";
   }
   cout<<endl;
   
}

[ Last edited by  stingbeh at 4-1-2008 10:28 PM ]
Reply

Use magic Report

Post time 8-1-2008 03:48 PM | Show all posts

  1. #include <iostream.h>

  2. class aloha
  3. {
  4.         public:
  5.                 void DisplayDetails();
  6. };

  7. void aloha:: DisplayDetails()
  8. {
  9.         cout<<"salam maal hijrah!";
  10. };

  11. int main()
  12. {
  13.         aloha word;
  14.         word.DisplayDetails();

  15.         return 0;
  16. };
Copy the Code
Reply

Use magic Report

Post time 8-1-2008 04:09 PM | Show all posts

Reply #76 i212's post


  1. #include <iostream.h>

  2. class dot
  3. {
  4.         public:
  5.                 void DisplayDetails();
  6. };

  7. void dot:: DisplayDetails()
  8. {
  9.         for (int i=5;i>=1;i--)
  10.         {
  11.                 for (int j=i;j>=1;j--)
  12.                         cout<<"*";
  13.                         cout<<"\n";
  14.         };
  15. };

  16. int main()
  17. {
  18.         dot word;
  19.         word.DisplayDetails();

  20.         return 0;
  21. };
Copy the Code


output

*****
****
***
**
*
Reply

Use magic Report

Post time 8-1-2008 04:20 PM | Show all posts
in java...


  1. class dotta
  2. {
  3.         public static void main(String argv[])
  4.         {
  5.                 for (int i=5;i>=1;i--)
  6.                 {
  7.                         for (int j=i;j>=1;j--)
  8.                        
  9.                         System.out.print("*");
  10.                         System.out.print("\n");
  11.                 }
  12.         }
  13. }
Copy the Code


output

*****
****
***
**
*
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

9-1-2025 05:25 AM GMT+8 , Processed in 0.061448 second(s), 30 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list