You shouldn't be assigning buffer; it's bad code (doesn't do what you want). You could use strncpy, but instead, why not just use the CString directly:
d[i] = atof(val.ElementAt(i));
Assuming you're compiling for MBCS, this should work.
BTW, you could also use the operator[] overload, to make the code slightly cleaner, eg:
d[i] = atof(val[i]);
Edit: If you're using UNICODE, you need the dynamic MBCS/UNICODE macro version of atof, which is _ttof. See http://msdn.microsoft.com/en-us/library/hc25t012%28v=VS.90%29.aspx for the full reference. So the code becomes:
d[i] = _ttof(var[i]);
Oh, forgot to include (duh): all these functions return a double, which is not necessarily the same thing as float. So change your result array to doubles, or explicitly cast the result of the conversion.