LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-15-2006, 05:41 AM   #1
touqeer.ansar
LQ Newbie
 
Registered: Jun 2006
Posts: 7

Rep: Reputation: 0
How can I convert string to MAC......


Basically I want to take MAC from command line so i got it as string.......tell me the algorithm by which i can convert this 17 byte MAC string like "00:0d:3f:cd:02:5f" to 6 byte MAC Address..
 
Old 06-15-2006, 06:01 AM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Given your example, try the following:

Byte A = 00
Byte B = 0D
Byte C = 3F
Byte D = CD
Byte E = 02
Byte F = 5F
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert string to wchar_t krishnacins Programming 1 03-28-2006 04:21 AM
C how to convert an integer to string? totti10 Programming 10 11-10-2005 05:49 AM
How to convert string to char? twirl Programming 27 10-13-2005 07:11 AM
Convert C++ string to C char* nyk Programming 3 06-17-2004 08:15 AM
How do you convert a string to an integer? wbdune Linux - Newbie 11 11-01-2003 02:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration