|
-
Sep 9th, 2002, 03:05 AM
#1
Thread Starter
Lively Member
C to VB - Float array to string
I need to convert my array of 8 floating point numbers into a string in my C program so i can sent it over the network so my VB program can read it.
How can i do this???
Thanks
Matt
-
Sep 9th, 2002, 03:18 AM
#2
Fanatic Member
you might get more response if you post this in the C/C++ forum. 
http://www.vbforums.com/forumdisplay...une=&forumid=9
-
Sep 9th, 2002, 03:24 AM
#3
Addicted Member
What sort of format do you want? Use function:
/* FCVT.C: This program converts the constant
* 3.1415926535 to a string and sets the pointer
* *buffer to point to that string.
*/
#include <stdlib.h>
#include <stdio.h>
void main( void )
{
int decimal, sign;
char *buffer;
double source = 3.1415926535;
buffer = _fcvt( source, 7, &decimal, &sign );
printf( "source: %2.10f buffer: '%s' decimal: %d sign: %d\n",
source, buffer, decimal, sign );
}
This is the docs given in MSDN. If you want to convert an array, just loop through it.
Hope it helps - give us a shout if you need a hand.
HD
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|