Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to push.back hex value in a vector using Loop

44 views
Skip to first unread message

K' Dash

unread,
Nov 13, 2014, 2:11:05 PM11/13/14
to
Dear fellows

bellow are the MAC address of my devices. I have a vector list std::vector<Maclist> m_listentry; in header file.


I want to create a function in which I want to push.back all the MAC addresses. My function is also here which is not finalize. please tell me how can I do this? if any one complete my function then I will be greatfull to him/her.

void
GUID_LMS_application::CreateLMSCache(Mac48Address mac, Ipv4Address ip)
{
for(int i=0; i<n; i++)
{



m_listentry.push_back ();
}
std::cout << "my server have the following MAC list of nodes \n" << m_listentry << "\n";
}



"00:00:00:00:00:01"
"00:00:00:00:00:02"
"00:00:00:00:00:03"
"00:00:00:00:00:04"
"00:00:00:00:00:05"
"00:00:00:00:00:06"
"00:00:00:00:00:07"
"00:00:00:00:00:08"
"00:00:00:00:00:09"
"00:00:00:00:00:0A"
"00:00:00:00:00:0B"
"00:00:00:00:00:0C"
"00:00:00:00:00:0D"
"00:00:00:00:00:0E"
"00:00:00:00:00:0F"
"00:00:00:00:00:10"
"00:00:00:00:00:11"
"00:00:00:00:00:12"
"00:00:00:00:00:13"
"00:00:00:00:00:14"
"00:00:00:00:00:15"
"00:00:00:00:00:16"
"00:00:00:00:00:17"
"00:00:00:00:00:18"
"00:00:00:00:00:19"
"00:00:00:00:00:1A"
"00:00:00:00:00:1B"
"00:00:00:00:00:1C"
"00:00:00:00:00:1D"
"00:00:00:00:00:1E"
"00:00:00:00:00:1F"
"00:00:00:00:00:20"
"00:00:00:00:00:21"
"00:00:00:00:00:22"
"00:00:00:00:00:23"
"00:00:00:00:00:24"
"00:00:00:00:00:25"
"00:00:00:00:00:26"
"00:00:00:00:00:27"
"00:00:00:00:00:28"
"00:00:00:00:00:29"
"00:00:00:00:00:2A"
"00:00:00:00:00:2B"
"00:00:00:00:00:2C"
"00:00:00:00:00:2D"
"00:00:00:00:00:2E"
"00:00:00:00:00:2F"
"00:00:00:00:00:30"
"00:00:00:00:00:31"
"00:00:00:00:00:32"
"00:00:00:00:00:33"
"00:00:00:00:00:34"
"00:00:00:00:00:35"
"00:00:00:00:00:36"
"00:00:00:00:00:37"
"00:00:00:00:00:38"
"00:00:00:00:00:39"
"00:00:00:00:00:3A"
"00:00:00:00:00:3B"
"00:00:00:00:00:3C"
"00:00:00:00:00:3D"
"00:00:00:00:00:3E"
"00:00:00:00:00:3F"
"00:00:00:00:00:40"
"00:00:00:00:00:41"
"00:00:00:00:00:42"
"00:00:00:00:00:43"
"00:00:00:00:00:44"
"00:00:00:00:00:45"
"00:00:00:00:00:46"
"00:00:00:00:00:47"
"00:00:00:00:00:48"
"00:00:00:00:00:49"
"00:00:00:00:00:4A"
"00:00:00:00:00:4B"
"00:00:00:00:00:4C"
"00:00:00:00:00:4D"
"00:00:00:00:00:4E"
"00:00:00:00:00:4F"
"00:00:00:00:00:50"
"00:00:00:00:00:51"
"00:00:00:00:00:52"
"00:00:00:00:00:53"
"00:00:00:00:00:54"
"00:00:00:00:00:55"
"00:00:00:00:00:56"
"00:00:00:00:00:57"
"00:00:00:00:00:58"
"00:00:00:00:00:59"
"00:00:00:00:00:5A"
"00:00:00:00:00:5B"
"00:00:00:00:00:5C"
"00:00:00:00:00:5D"
"00:00:00:00:00:5E"
"00:00:00:00:00:5F"
"00:00:00:00:00:60"
"00:00:00:00:00:61"
"00:00:00:00:00:62"
"00:00:00:00:00:63"
"00:00:00:00:00:64"
"00:00:00:00:00:65"
"00:00:00:00:00:66"
"00:00:00:00:00:67"
"00:00:00:00:00:68"
"00:00:00:00:00:69"
"00:00:00:00:00:6A"
"00:00:00:00:00:6B"
"00:00:00:00:00:6C"
"00:00:00:00:00:6D"
"00:00:00:00:00:6E"
"00:00:00:00:00:6F"
"00:00:00:00:00:70"
"00:00:00:00:00:71"
"00:00:00:00:00:72"
"00:00:00:00:00:73"
"00:00:00:00:00:74"
"00:00:00:00:00:75"
"00:00:00:00:00:76"
"00:00:00:00:00:77"
"00:00:00:00:00:78"
"00:00:00:00:00:79"
"00:00:00:00:00:7A"
"00:00:00:00:00:7B"
"00:00:00:00:00:7C"
"00:00:00:00:00:7D"
"00:00:00:00:00:7E"
"00:00:00:00:00:7F"
"00:00:00:00:00:80"
"00:00:00:00:00:81"
"00:00:00:00:00:82"
"00:00:00:00:00:83"
"00:00:00:00:00:84"
"00:00:00:00:00:85"
"00:00:00:00:00:86"
"00:00:00:00:00:87"
"00:00:00:00:00:88"
"00:00:00:00:00:89"
"00:00:00:00:00:8A"
"00:00:00:00:00:8B"
"00:00:00:00:00:8C"
"00:00:00:00:00:8D"
"00:00:00:00:00:8E"
"00:00:00:00:00:8F"
"00:00:00:00:00:90"
"00:00:00:00:00:91"
"00:00:00:00:00:92"
"00:00:00:00:00:93"
"00:00:00:00:00:94"
"00:00:00:00:00:95"
"00:00:00:00:00:96"
"00:00:00:00:00:97"
"00:00:00:00:00:98"
"00:00:00:00:00:99"
"00:00:00:00:00:9A"
"00:00:00:00:00:9B"
"00:00:00:00:00:9C"
"00:00:00:00:00:9D"
"00:00:00:00:00:9E"
"00:00:00:00:00:9F"
"00:00:00:00:00:A0"
"00:00:00:00:00:A1"
"00:00:00:00:00:A2"
"00:00:00:00:00:A3"
"00:00:00:00:00:A4"
"00:00:00:00:00:A5"
"00:00:00:00:00:A6"
"00:00:00:00:00:A7"
"00:00:00:00:00:A8"
"00:00:00:00:00:A9"
"00:00:00:00:00:AA"
"00:00:00:00:00:AB"
"00:00:00:00:00:AC"
"00:00:00:00:00:AD"
"00:00:00:00:00:AE"
"00:00:00:00:00:AF"
"00:00:00:00:00:B0"
"00:00:00:00:00:B1"
"00:00:00:00:00:B2"
"00:00:00:00:00:B3"
"00:00:00:00:00:B4"
"00:00:00:00:00:B5"
"00:00:00:00:00:B6"
"00:00:00:00:00:B7"
"00:00:00:00:00:B8"
"00:00:00:00:00:B9"
"00:00:00:00:00:BA"
"00:00:00:00:00:BB"
"00:00:00:00:00:BC"
"00:00:00:00:00:BD"
"00:00:00:00:00:BE"
"00:00:00:00:00:BF"
"00:00:00:00:00:C0"
"00:00:00:00:00:C1"
"00:00:00:00:00:C2"
"00:00:00:00:00:C3"
"00:00:00:00:00:C4"
"00:00:00:00:00:C5"
"00:00:00:00:00:C6"
"00:00:00:00:00:C7"
"00:00:00:00:00:C8"
"00:00:00:00:00:C9"
"00:00:00:00:00:CA"
"00:00:00:00:00:CB"
"00:00:00:00:00:CC"
"00:00:00:00:00:CD"
"00:00:00:00:00:CE"
"00:00:00:00:00:CF"
"00:00:00:00:00:D0"
"00:00:00:00:00:D1"
"00:00:00:00:00:D2"

Barry Schwarz

unread,
Nov 14, 2014, 12:49:25 AM11/14/14
to
On Thu, 13 Nov 2014 11:10:45 -0800 (PST), "K' Dash"
<adnanr...@gmail.com> wrote:

Please set you newsreader line length to something less than 80

>bellow are the MAC address of my devices. I have a vector list std::vector<Maclist> m_listentry; in header file.

You should never define an object in a header. What is the type
Maclist?

>I want to create a function in which I want to push.back all the MAC addresses. My function is also here which is not finalize. please tell me how can I do this? if any one complete my function then I will be greatfull to him/her.
>
>void
>GUID_LMS_application::CreateLMSCache(Mac48Address mac, Ipv4Address ip)

What are the types Mac48Address and Ipv4Address?

>{
> for(int i=0; i<n; i++)
> {
>
>
>
> m_listentry.push_back ();
>}
>std::cout << "my server have the following MAC list of nodes \n" << m_listentry << "\n";
>}
>
>"00:00:00:00:00:01"
>"00:00:00:00:00:02"
>"00:00:00:00:00:03"

We really didn't need two hundred lines of examples.

--
Remove del for email

K' Dash

unread,
Nov 14, 2014, 8:40:32 AM11/14/14
to
You should never define an object in a header. What is the type
Maclist?

Answer:
1. I declare the object in .h file and want to put MAC values in .cc file
2. class Maclist: public Object

What are the types Mac48Address and Ipv4Address?
Answer:
both are classes, you can find further information about these classes from below link.
http://www.nsnam.org/docs/release/3.21/doxygen/classns3_1_1_mac48_address.html

http://www.nsnam.org/docs/release/3.21/doxygen/classns3_1_1_ipv4_address.html

0 new messages