Click here to Skip to main content
15,907,874 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to make a function that you can pass any type of array to?? Pin
johnstonsk30-Jul-03 10:02
johnstonsk30-Jul-03 10:02 
AnswerRe: How to make a function that you can pass any type of array to?? Pin
Dean Goodman30-Jul-03 10:20
Dean Goodman30-Jul-03 10:20 
GeneralRe: How to make a function that you can pass any type of array to?? Pin
johnstonsk30-Jul-03 10:33
johnstonsk30-Jul-03 10:33 
GeneralRe: How to make a function that you can pass any type of array to?? Pin
Ian Darling30-Jul-03 11:19
Ian Darling30-Jul-03 11:19 
GeneralRe: How to make a function that you can pass any type of array to?? Pin
Dean Goodman30-Jul-03 11:42
Dean Goodman30-Jul-03 11:42 
AnswerRe: How to make a function that you can pass any type of array to?? Pin
Neville Franks30-Jul-03 10:33
Neville Franks30-Jul-03 10:33 
AnswerRe: How to make a function that you can pass any type of array to?? Pin
Ian Darling30-Jul-03 11:12
Ian Darling30-Jul-03 11:12 
GeneralRe: How to make a function that you can pass any type of array to?? Pin
Jörgen Sigvardsson30-Jul-03 11:55
Jörgen Sigvardsson30-Jul-03 11:55 
template <typename ForwardIter> void MyFunction(ForwardIter start, ForwardIter end)
{
    while(start != end) {
        doSomething(*start);
        ++start;
    }
}
  
char temp[100];
MyFunction(temp, temp + 100);
Would be a cleaner solution, as your will only work with std::vector. This'll work with any iterator.

--
Gnnnnmmmpppppppfffffhhh!
GeneralRe: How to make a function that you can pass any type of array to?? Pin
Ian Darling30-Jul-03 12:58
Ian Darling30-Jul-03 12:58 
AnswerRe: How to make a function that you can pass any type of array to?? Pin
John M. Drescher30-Jul-03 11:53
John M. Drescher30-Jul-03 11:53 
GeneralShellExecute and highlighting Pin
heju30-Jul-03 9:57
heju30-Jul-03 9:57 
GeneralCMainFrame Pin
act_x30-Jul-03 9:35
act_x30-Jul-03 9:35 
GeneralToolBar Pin
Anonymous30-Jul-03 8:36
Anonymous30-Jul-03 8:36 
GeneralRe: ToolBar Pin
Frank K31-Jul-03 0:50
Frank K31-Jul-03 0:50 
GeneralDialog events when in a View Pin
Anonymous30-Jul-03 8:31
Anonymous30-Jul-03 8:31 
GeneralRe: Dialog events when in a View Pin
Bob Stanneveld30-Jul-03 9:19
Bob Stanneveld30-Jul-03 9:19 
Questionfunction that doesn't care about the type in the paramater?? Pin
johnstonsk30-Jul-03 8:23
johnstonsk30-Jul-03 8:23 
AnswerRe: function that doesn't care about the type in the paramater?? Pin
Brian Delahunty30-Jul-03 9:37
Brian Delahunty30-Jul-03 9:37 
GeneralRe: function that doesn't care about the type in the paramater?? Pin
johnstonsk30-Jul-03 9:46
johnstonsk30-Jul-03 9:46 
QuestionCDialogBar ????? Pin
Shay Harel30-Jul-03 8:03
Shay Harel30-Jul-03 8:03 
GeneralUnwanted color change when Edit box is ReadOnly Pin
Aidman30-Jul-03 7:07
Aidman30-Jul-03 7:07 
GeneralRe: Unwanted color change when Edit box is ReadOnly Pin
l a u r e n30-Jul-03 7:20
l a u r e n30-Jul-03 7:20 
GeneralRe: Unwanted color change when Edit box is ReadOnly Pin
Renjith Ramachandran30-Jul-03 8:13
Renjith Ramachandran30-Jul-03 8:13 
GeneralRe: Unwanted color change when Edit box is ReadOnly Pin
Aidman30-Jul-03 8:20
Aidman30-Jul-03 8:20 
GeneralRe: Unwanted color change when Edit box is ReadOnly Pin
John M. Drescher30-Jul-03 15:06
John M. Drescher30-Jul-03 15:06 

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.