Click here to Skip to main content
15,917,538 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: making win32 Dll Pin
Nishad S2-Feb-09 17:18
Nishad S2-Feb-09 17:18 
GeneralRe: making win32 Dll Pin
hrishiS2-Feb-09 19:51
hrishiS2-Feb-09 19:51 
GeneralRe: making win32 Dll Pin
Nishad S2-Feb-09 19:55
Nishad S2-Feb-09 19:55 
GeneralRe: making win32 Dll Pin
hrishiS1-Feb-09 20:10
hrishiS1-Feb-09 20:10 
AnswerRe: making win32 Dll Pin
Iain Clarke, Warrior Programmer1-Feb-09 23:04
Iain Clarke, Warrior Programmer1-Feb-09 23:04 
GeneralRe: making win32 Dll Pin
Nishad S1-Feb-09 23:45
Nishad S1-Feb-09 23:45 
GeneralRe: making win32 Dll Pin
Iain Clarke, Warrior Programmer1-Feb-09 23:56
Iain Clarke, Warrior Programmer1-Feb-09 23:56 
QuestionFunction Taking Generic Vector? Pin
gvanto1-Feb-09 18:01
gvanto1-Feb-09 18:01 
I was wondering if there's a way to take a vector of any type into the argument of a function somehow?

So instead of:
showVectorSizeAndContents ( vector<int> v ) it can be of any type, not just int?

Thanks alot
gvanto

[CODE]
/*
* 4_VectorDemo2_InsertDelete.cpp
*
* Created on: 2/02/2009
* Author: pacific
*/

//Vector basics:

#include <iostream>
#include <vector>
using namespace std;

void showVectorSizeAndContents(vector<int> v) { // here i'd like a vector of any type to be passed ...?
unsigned int i = 0;
cout << "Current contents:\n";
cout << "Size = " << v.size() << endl;
// display contents of vector
for(i=0; i<v.size();> cout << v[i] << " ";
}
cout << endl;
cout << endl;
return;
}


int main() {

vector<char> v;
unsigned int i;

for(i = 0; i < 10; i++) {
v.push_back('A' + i);
}

//cant call the show method since it takes vector<int>

}


[/CODE]

Find Your Dream Job in Australia, Free!
http://www.WebCV.com.au

AnswerRe: Function Taking Generic Vector? [modified] Pin
Naveen1-Feb-09 18:41
Naveen1-Feb-09 18:41 
GeneralRe: Function Taking Generic Vector? Pin
Nishad S1-Feb-09 19:12
Nishad S1-Feb-09 19:12 
GeneralRe: Function Taking Generic Vector? Pin
Naveen1-Feb-09 19:23
Naveen1-Feb-09 19:23 
AnswerRe: Function Taking Generic Vector? Pin
Stephen Hewitt1-Feb-09 19:18
Stephen Hewitt1-Feb-09 19:18 
GeneralRe: Function Taking Generic Vector? Pin
gvanto2-Feb-09 12:26
gvanto2-Feb-09 12:26 
QuestionRe: Function Taking Generic Vector? Pin
gvanto2-Feb-09 12:56
gvanto2-Feb-09 12:56 
AnswerRe: Function Taking Generic Vector? Pin
Stephen Hewitt4-Feb-09 1:15
Stephen Hewitt4-Feb-09 1:15 
GeneralRe: Function Taking Generic Vector? Pin
gvanto5-Feb-09 11:44
gvanto5-Feb-09 11:44 
AnswerRe: Function Taking Generic Vector? Pin
Nishad S1-Feb-09 19:25
Nishad S1-Feb-09 19:25 
QuestionFolder Copy Pin
Davitor1-Feb-09 17:30
Davitor1-Feb-09 17:30 
AnswerRe: Folder Copy Pin
«_Superman_»1-Feb-09 17:58
professional«_Superman_»1-Feb-09 17:58 
GeneralRe: Folder Copy Pin
Davitor1-Feb-09 18:09
Davitor1-Feb-09 18:09 
QuestionRe: Folder Copy Pin
David Crow2-Feb-09 5:52
David Crow2-Feb-09 5:52 
AnswerRe: Folder Copy Pin
«_Superman_»1-Feb-09 18:12
professional«_Superman_»1-Feb-09 18:12 
AnswerRe: Folder Copy Pin
ATM@CodeProject1-Feb-09 18:52
ATM@CodeProject1-Feb-09 18:52 
QuestionTemplate Class: Problem with Header file Pin
gvanto1-Feb-09 13:53
gvanto1-Feb-09 13:53 
AnswerRe: Template Class: Problem with Header file Pin
«_Superman_»1-Feb-09 17:20
professional«_Superman_»1-Feb-09 17:20 

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.