|
|
|
#1 (permalink) | ||||||||||||||
|
4.0 GHz
![]()
Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 885
Rep: 45
![]() Unique Rep: 43
Trader Rating: 1
|
I'm wondering when to use "." and "->" when working with vectors in C++
can anyone help
__________________
I'm a junior in college, Comp Sci major/math minor, if you wanna talk, send me a pm ![]() The *OFFICIAL* HAF 932 Case Owners Club My HAF 932 Paint Job![]() Water Cooling (own red, need black) Quote:
|
||||||||||||||
|
|
|
|
|
#2 (permalink) | |||||||||||||
|
With great difficulty
![]() |
-> is for use with pointers
__________________Code:
#include <vector>
#include <iostream>
using std::vector;
using std::cout;
using std::endl;
int main(void){
vector<int> stack;
vector<int> *heap = new vector<int>;
stack.push_back(1);
heap->push_back(1);
cout << stack.size() << " " << heap->size() << endl;
return 0;
}
|
|||||||||||||
|
|
|
|
#3 (permalink) | ||||||||||||||
|
4.0 GHz
![]()
Join Date: Dec 2008
Location: Dripping Springs/Denton
Posts: 885
Rep: 45
![]() Unique Rep: 43
Trader Rating: 1
|
awesome man. thanks a bunch
__________________
I'm a junior in college, Comp Sci major/math minor, if you wanna talk, send me a pm ![]() The *OFFICIAL* HAF 932 Case Owners Club My HAF 932 Paint Job![]() Water Cooling (own red, need black) Quote:
|
||||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|