C# converting int to hex <p>This is a small snippet of the code I have written in Visual Studio. I need to convert the int <code>add</code> into an hex value (later into a string) as I am accessing the memory of a uC. But when I view the variable during debugging it displays it as a string "add16". What could I be doing wrong?</p> <pre><code>for (int add = 0; add &lt;= 0xfffff; ) { for (int X = 0; X &lt;= 15; X++) { string address = add.ToString("add16"); addr = Convert.ToString(address); port.WriteLine(String.Format("WRBK:{0}:{1}", addr, parts[X])); add++; } } </code></pre>