Click here to Skip to main content
16,016,088 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LPCTSTR strText? Pin
Larsson24-Sep-04 13:30
Larsson24-Sep-04 13:30 
GeneralRe: LPCTSTR strText? Pin
Larsson24-Sep-04 13:47
Larsson24-Sep-04 13:47 
GeneralRe: LPCTSTR strText? Pin
ThatsAlok24-Sep-04 20:22
ThatsAlok24-Sep-04 20:22 
GeneralResource Error (Opened in another editor) Pin
brdavid24-Sep-04 12:17
brdavid24-Sep-04 12:17 
GeneralRe: Resource Error (Opened in another editor) Pin
Gary R. Wheeler24-Sep-04 16:03
Gary R. Wheeler24-Sep-04 16:03 
GeneralRe: Resource Error (Opened in another editor) Pin
brdavid25-Sep-04 4:43
brdavid25-Sep-04 4:43 
GeneralRe: Resource Error (Opened in another editor) Pin
brdavid25-Sep-04 11:18
brdavid25-Sep-04 11:18 
Generalinteger displayed instead of string Pin
lordmickel24-Sep-04 12:11
lordmickel24-Sep-04 12:11 
Why does the output of driver.get_name() display a number instead of the string of characters passed to driver.set_name() ?

I've not done C++ in quite some time so any help would be great.

Thanks in advance.

code:


///////////////// from .cpp file ///////////////

details driver;

driver.set_name("abc");

cout << "name = " << driver.get_name() << endl;

///////////////////////////////////////////////////////////



/////////////////////// the class /////////////////////////////////////////
#ifndef DETAILS_H
#define DETAILS_H

class details
{
public:
int get_name();
int get_grade();
void set_name(char name[3]);
void set_grade(int the_grade);

private:
int name[3];
int grade;

};



int details::get_name()
{
return name[3];
}
int details::get_grade()
{
return grade;
}

void details::set_name(char the_name[3])
{
name[3] = the_name[3];
}

void details::set_grade(int the_grade)
{
grade = the_grade;
}
#endif
/////////////////////////////////////////////////////////////////////
GeneralRe: integer displayed instead of string Pin
Alexander M.,24-Sep-04 12:40
Alexander M.,24-Sep-04 12:40 
GeneralRe: integer displayed instead of string Pin
lordmickel25-Sep-04 10:45
lordmickel25-Sep-04 10:45 
GeneralString editing using Borland C++ and AIX in Linux Pin
youngashish24-Sep-04 12:09
youngashish24-Sep-04 12:09 
GeneralRe: String editing using Borland C++ and AIX in Linux Pin
Aamir Butt24-Sep-04 20:13
Aamir Butt24-Sep-04 20:13 
GeneralRe: String editing using Borland C++ and AIX in Linux Pin
Anonymous25-Sep-04 11:05
Anonymous25-Sep-04 11:05 
QuestionGetMenuItemInfo didn't work in WinNT 4.0, why? Pin
Cyrus Dang24-Sep-04 11:50
Cyrus Dang24-Sep-04 11:50 
AnswerRe: GetMenuItemInfo didn't work in WinNT 4.0, why? Pin
David Crow24-Sep-04 12:07
David Crow24-Sep-04 12:07 
AnswerRe: GetMenuItemInfo didn't work in WinNT 4.0, why? Pin
Michael Dunn24-Sep-04 12:34
sitebuilderMichael Dunn24-Sep-04 12:34 
GeneralRe: GetMenuItemInfo didn't work in WinNT 4.0, why? Pin
Cyrus Dang24-Sep-04 12:56
Cyrus Dang24-Sep-04 12:56 
GeneralBypassing Declarative Security Pin
Chef Jeff24-Sep-04 11:40
sussChef Jeff24-Sep-04 11:40 
QuestionHow to change wchar string to CString easily Pin
sixiang24-Sep-04 11:12
sixiang24-Sep-04 11:12 
AnswerRe: How to change wchar string to CString easily Pin
Alexander M.,24-Sep-04 12:35
Alexander M.,24-Sep-04 12:35 
GeneralRe: How to change wchar string to CString easily Pin
sixiang24-Sep-04 13:49
sixiang24-Sep-04 13:49 
GeneralRe: How to change wchar string to CString easily Pin
Alexander M.,25-Sep-04 0:20
Alexander M.,25-Sep-04 0:20 
AnswerRe: How to change wchar string to CString easily Pin
Michael Dunn24-Sep-04 12:36
sitebuilderMichael Dunn24-Sep-04 12:36 
General#define SOMETHING in new configuration type Pin
BlackDice24-Sep-04 9:09
BlackDice24-Sep-04 9:09 
GeneralRESOLVED Pin
BlackDice24-Sep-04 9:32
BlackDice24-Sep-04 9:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.