Click here to Skip to main content
16,011,502 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Text editing app with special objects Pin
Ryan Binns26-Jun-03 14:43
Ryan Binns26-Jun-03 14:43 
GeneralRe: Text editing app with special objects Pin
PaulFrazee26-Jun-03 17:33
PaulFrazee26-Jun-03 17:33 
GeneralRe: Text editing app with special objects Pin
Ryan Binns26-Jun-03 18:08
Ryan Binns26-Jun-03 18:08 
GeneralRe: Text editing app with special objects Pin
PaulFrazee27-Jun-03 4:04
PaulFrazee27-Jun-03 4:04 
GeneralRe: Text editing app with special objects Pin
Ryan Binns27-Jun-03 4:12
Ryan Binns27-Jun-03 4:12 
GeneralRe: Text editing app with special objects Pin
PaulFrazee27-Jun-03 5:19
PaulFrazee27-Jun-03 5:19 
GeneralRe: Text editing app with special objects Pin
Ryan Binns27-Jun-03 5:21
Ryan Binns27-Jun-03 5:21 
GeneralJust learning STL.. easy question.. Pin
RobJones26-Jun-03 6:33
RobJones26-Jun-03 6:33 
Hello,
In the past I have always used CArray.. I want to get away from it and start using STL's vector.. I bought a book “STL Programming from the ground up” by Herbert Schildt. After reading the first few chapters I realize that it't pretty easy to use vector.. My question is how do I create an array/vector of structures (The book doesn't have any examples that I have found so far). Here’s what I've tried.. and obviously it doesn't work.

#include "stdafx.h"
#include <iostream>
#include <vector>

using namespace std;

// My ports struct..
struct s_Ports
{
int iPort; // Default Port #.
int iFilePort; // File Transfer Port #.
};

int main(int argc, char* argv[])
{
s_Ports p;
p.iPort = 20;
p.iFilePort = 21;

// How do I do this??
vector <p,&p> vec(10);

return 0;
}

Whoever said nothing's impossible never tried slamming a revolving door!
GeneralRe: Just learning STL.. easy question.. Pin
keegan26-Jun-03 6:37
keegan26-Jun-03 6:37 
GeneralRe: Just learning STL.. easy question.. Pin
John M. Drescher26-Jun-03 6:39
John M. Drescher26-Jun-03 6:39 
GeneralRe: Just learning STL.. easy question.. Pin
RobJones26-Jun-03 6:56
RobJones26-Jun-03 6:56 
GeneralRe: Just learning STL.. easy question.. Pin
John M. Drescher26-Jun-03 7:14
John M. Drescher26-Jun-03 7:14 
Generalanother quick question.. Pin
RobJones26-Jun-03 8:37
RobJones26-Jun-03 8:37 
GeneralRe: another quick question.. Pin
John M. Drescher26-Jun-03 8:52
John M. Drescher26-Jun-03 8:52 
GeneralRe: another quick question.. Pin
RobJones26-Jun-03 9:14
RobJones26-Jun-03 9:14 
GeneralRe: another quick question.. Pin
CyberDen26-Jun-03 9:36
CyberDen26-Jun-03 9:36 
GeneralOwn client/server and 10053 problem Pin
justin22326-Jun-03 6:31
justin22326-Jun-03 6:31 
GeneralRe: Own client/server and 10053 problem Pin
keegan26-Jun-03 6:35
keegan26-Jun-03 6:35 
GeneralRe: Own client/server and 10053 problem Pin
justin22326-Jun-03 7:21
justin22326-Jun-03 7:21 
GeneralRe: Own client/server and 10053 problem Pin
justin22326-Jun-03 7:27
justin22326-Jun-03 7:27 
GeneralRe: Own client/server and 10053 problem Pin
RobJones26-Jun-03 10:56
RobJones26-Jun-03 10:56 
GeneralVersion number Pin
Anonymous26-Jun-03 5:35
Anonymous26-Jun-03 5:35 
GeneralRe: Version number Pin
basementman26-Jun-03 6:33
basementman26-Jun-03 6:33 
GeneralI need AIR &amp; I'm pulling my hair out over Random doubles within a specified range Pin
johnstonsk26-Jun-03 5:21
johnstonsk26-Jun-03 5:21 
GeneralRe: I need AIR &amp; I'm pulling my hair out over Random doubles within a specified range Pin
Ryan Binns26-Jun-03 5:29
Ryan Binns26-Jun-03 5:29 

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.