vector inside of structure , how to assign value

Dear all,
My program is..

#include<iostream>

using namespace std;

typedef vector<int> link_value;

struct link_states {

int c;
char z;

link_value link_rssi_value;

};

int main()
{
link_states ls;

link_value lv;
lv.push_back(90);

vector<int> iterator::it;

ls.a=10;
ls.z = 'a';
for (it =lv.begin(); it< lv.end(); it++)
{
ls. link_rssi_value = it;
}
}



How to assign the vector into structure link_rssi_value , I am confusing how to?


I am getting big error at line number 29 : error is
closed account (DSLq5Di1)
error is.. ? *taps foot impatiently*

ls.link_rssi_value = it;.. what you have here is vector<int> = vector<int>::iterator??

If you are just trying to copy the vector, ls.link_rssi_value = lv;. Though why not do away with the temporary and use the vector in your structure directly?
Dear friend ,
According to you I were tried but I am getting following error as :

error: expected primary-expression before ‘;’ token

line : ls.link_rssi_value -=lv;

please could you help me get out this problem...

Best regards
Babu
Dear BABU Prasad G,

I happy to announce, that we can speed up finding the solution for your problem.
Please follow next link: http://codepad.org/
Choose C or C++ (depend on your problem) (On my opinion, it is C++).
Insert your code.
Copy link to page with inserted code here.

Many thanks for your question, it is really important to us.

Best Regards,
Ivan Sidarau.
Topic archived. No new replies allowed.