Click here to Skip to main content
15,898,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to organize MFC project directory structure - main and DLL programs? Pin
Vaclav_7-Mar-10 9:05
Vaclav_7-Mar-10 9:05 
AnswerRe: How to organize MFC project directory structure - main and DLL programs? Pin
Joe Woodbury7-Mar-10 9:50
professionalJoe Woodbury7-Mar-10 9:50 
GeneralRe: How to organize MFC project directory structure - main and DLL programs? Pin
Vaclav_7-Mar-10 12:08
Vaclav_7-Mar-10 12:08 
Questionabout *p++ [modified] Pin
HOW WHAT7-Mar-10 0:22
HOW WHAT7-Mar-10 0:22 
AnswerRe: about *p++ Pin
Richard MacCutchan7-Mar-10 2:18
mveRichard MacCutchan7-Mar-10 2:18 
AnswerRe: about *p++ Pin
Maximilien7-Mar-10 2:28
Maximilien7-Mar-10 2:28 
QuestionTypedef defined Pin
Herboren6-Mar-10 21:49
Herboren6-Mar-10 21:49 
AnswerRe: Typedef defined Pin
Stephen Hewitt7-Mar-10 1:00
Stephen Hewitt7-Mar-10 1:00 
I'm not exactly sure what you're asking. ThreeStrings can be used anywhere its definition is "visible": in this case anywhere in the file "Typedef.cpp" after "typedef string ThreeStrings[3];". Also note that's it's simply a typedef for an array of three std::strings so anywhere you see this:
ThreeStrings xxx;

it is equivalent to this:
std::string xxx[3];



islands is a local variable. It is mutable (its contents can be changed). Normally it is only visible within the _tmain function. It can be made available to functions called by _tmain (and functions called by functions called by _tmain, and so on) by passing a pointer or reference to it (or by making a pointer or reference to it accessible by some other means). For example:
void function(ThreeStrings &i)
{
    i[0] = "I changed it!"; 
}
 
int _tmain(int argc, _TCHAR* argv[])
{
	ThreeStrings islands = { "Fiji" , "Caribbean" , "Bora Bora" };

        function(islands);
 
	for (int i=0 ; i < sizeof(islands) / sizeof(string); i++)
		cout << "\n\t" << islands[i] << "\n" << endl;
&nbsp;
	_getch();
	return 0;
}
Steve

GeneralRe: Typedef defined Pin
Herboren7-Mar-10 7:11
Herboren7-Mar-10 7:11 
GeneralRe: Typedef defined Pin
Tim Craig7-Mar-10 9:21
Tim Craig7-Mar-10 9:21 
QuestionCRichEditCtrl Line Break Pin
ForNow6-Mar-10 17:01
ForNow6-Mar-10 17:01 
GeneralRe: CRichEditCtrl Line Break Pin
Rage8-Mar-10 4:35
professionalRage8-Mar-10 4:35 
QuestionExiting Application Pin
MrMcIntyre6-Mar-10 9:51
MrMcIntyre6-Mar-10 9:51 
AnswerRe: Exiting Application Pin
LunaticFringe6-Mar-10 10:05
LunaticFringe6-Mar-10 10:05 
GeneralRe: Exiting Application Pin
MrMcIntyre6-Mar-10 10:09
MrMcIntyre6-Mar-10 10:09 
AnswerRe: Exiting Application Pin
Luc Pattyn6-Mar-10 10:09
sitebuilderLuc Pattyn6-Mar-10 10:09 
GeneralRe: Exiting Application Pin
MrMcIntyre6-Mar-10 10:15
MrMcIntyre6-Mar-10 10:15 
GeneralRe: Exiting Application Pin
Tim Craig6-Mar-10 10:26
Tim Craig6-Mar-10 10:26 
GeneralRe: Exiting Application Pin
MrMcIntyre6-Mar-10 10:32
MrMcIntyre6-Mar-10 10:32 
GeneralRe: Exiting Application Pin
MrMcIntyre6-Mar-10 10:39
MrMcIntyre6-Mar-10 10:39 
GeneralRe: Exiting Application Pin
Tim Craig6-Mar-10 11:02
Tim Craig6-Mar-10 11:02 
GeneralRe: Exiting Application Pin
LunaticFringe7-Mar-10 0:27
LunaticFringe7-Mar-10 0:27 
GeneralRe: Exiting Application Pin
Richard MacCutchan7-Mar-10 2:10
mveRichard MacCutchan7-Mar-10 2:10 
GeneralRe: Exiting Application Pin
Tim Craig7-Mar-10 9:08
Tim Craig7-Mar-10 9:08 
GeneralRe: Exiting Application Pin
LunaticFringe7-Mar-10 9:22
LunaticFringe7-Mar-10 9:22 

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.