1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 <2006> 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 <2006> 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Sequencer embedded C code question |
From: | Eric Norum <[email protected]> |
To: | Jiro Fujita <[email protected]> |
Cc: | [email protected] |
Date: | Thu, 29 Jun 2006 15:52:48 -0500 |
I'm not sure what you have changed, but the code you posted originally seems to be mixing up the notion of "array of characters" and "pointer to character". See my comment below: program snchygrometer %%#include <ctype.h> %%#include <stdlib.h> %%#include <stdio.h> %%char rob[10] ; char *roba; assign roba to "rawdata" ; monitor roba ; float ch1 ; float ch2 ; float ch3 ; float ch4 ; float ch5 ; assign ch1 to "PV1"; assign ch2 to "PV2"; assign ch3 to "PV3"; assign ch4 to "PV4"; assign ch5 to "PV5"; int v ; float z ; %%extern char *wa1 ; %%char *sign="+-" ; %{ rob=&roba <<<<<<<<<<<<< EVEN WITH A SEMICOLON AT THE END THIS LINE MAKES NO SENSE. v=rob[0]; /*Get first char from string*/ wa1=strpbrk(rob, "+-"); /*Break string at +-,rest is wa1*/ z=(float)wa1; /*convert string to float z*/ }% Perhaps you could mail me your latest code?? |