i’m unique
Member Function : getline()
{ C++ } { }
09
October
2008

Here is another that i get from Agus about C++ program. The question is look simple, but to make this program using C++, we need to know about member function that called getline. For more information about this function, please try to find using Google or directly open this site. And this is the example program that using getline() function on C++ and also the answer for Agus.

#include <iostream.h>
#include <conio.h>

void main()
{
clrscr();
char name[100];
char address[200];
char birth_month[50];
int birth_year;
cout<<”Name           : “;
cin.getline(name, sizeof(name));
cout<<”Address        : “;
cin.getline(address, sizeof(address));
cout<<”Month of birth : “;
cin.getline(birth_month, sizeof(birth_month));
cout<<”Year of birth  : “;
cin>>birth_year;
cout<<”Thank you, press any key to see the result…”<<endl;
getch();
clrscr();
cout<<”====================Your Biodata=====================”<<endl<<endl;
cout<<”Name           : “<<name<<endl;
cout<<”Address        : “<<address<<endl;
cout<<”Month of birth : “<<birth_month<<endl;
cout<<”Year of birth  : “<<birth_year<<endl;
cout<<endl<<”=====================================================”<<endl;
getch();
}

Or you can download the C++ code here. Good luck.

Related Posts

13 Comment

Fachia
October 10th, 2008 at 12:47 am

even I’m still a newbie in coding -espc C++- but I can understand this cool tips. You’ve just explained well.. :D

thank you :-)

ruben
October 10th, 2008 at 4:36 am

ouww.. its take value from an array .. isn it??
i have studied C and C# but C++ haven’t..

something like that, array of character

okta sihotang
October 10th, 2008 at 6:28 am

hmmn.. C++ ?
aku belum pernah belajar C++ bli…
bahasa C dan C# yang sudah ;)

saya malah ga pernah tahu C dan C#, menurut buku sih katanya C++ itu pengembangan dari C.

Masenchipz
October 11th, 2008 at 11:00 am

gw taunya foxpro doank… baru juga ASP.net kmarin2 di training dari kantor… he..he…

kenapa nggak PHP aja
*biar bisa share :D

akangjuned
October 11th, 2008 at 9:26 pm

masih bingung sayah :(

bingung kenapa?

Tanggu
October 12th, 2008 at 1:05 am

wow C++?? klo P++ (pijet plus plus) baru saya ngerti…. hehee

kok saya merasa ada yang terlalu merendah disini :p

Artha
October 13th, 2008 at 2:32 am

ajari lagi donk C Pelus pelus
udah lupa nih

hahahaha, becanda ah bli ini

ghozan
October 13th, 2008 at 7:30 am

wah pak dosen bener2 seneng ma c++ yah… saya masih setia dengan .NET

ya begitulah, ini terpaksa buat ngajar algoritma :D

Cadink
October 13th, 2008 at 10:21 pm

C++ ?? Kalo C+1+n+t+4 baru tau…. hee :)

hahahaha, becanda aja nih

pande ndak baik
October 14th, 2008 at 10:45 pm

Nah ni dia nih…. Siap-siap bantuin saya ya. :)

with my pleasure

Ayuni
October 15th, 2008 at 9:06 pm

huu huuu.. binun,

mendingan pake manual aja..

* tuiingg sok teu gw :P, mahap becanda

hehehe, no worry lah

vie
vie
November 13th, 2008 at 11:52 pm

kasi tau dong rumus C++ untuk menghitung frekuensi muncul-nya huruf dalam sebuah kalimat…. udah stuck b-g-t neh… pliss y…

please check here

wirautama.net &raquo; Blog Archive &raquo; Menghitung Jumlah Huruf Dalam Kalimat
November 26th, 2008 at 9:53 pm

[…] this post because I confuse how to describe about this post. As usually, I get questions about C++ here and I will try to answer as I can. The question is how to calculate the frequency of each letter […]

Leave a Reply