The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 about sscanf
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

trueone

USA
2 Posts

Posted - 02/09/2003 :  1:31:06 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
hi all,

I need to use sscanf in my script, but when I build my program, it says "Error, function or variable sscanf not found"; However, I have included "string.h" in my file.

The following is quoted from Origin C help, it doesn't work also.
-----------------------------------------------
char str2[10], str1[]="Hello C 15 17.56";
char cChar;
int iInt;
float fFloat;
int N;
N = sscanf( str1, "%s %c %d %f", str2, &cChar, &iInt, &fFloat);
out_str(str1);
out_str(str2);
printf("%c\n",cChar);
out_int("",iInt);
out_double("",fFloat);
-------------------------------------------------

Can you help me?

Richard

cpyang

USA
1406 Posts

Posted - 02/09/2003 :  2:16:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Which version of Origin are you using?

It is possible that the help files that you obtained via Check-For-Update was reading from more recent header files (string.h) that what was included in the service release. If you fix this yourself by making some small change to your string.h file

1. local the line in string.h
#pragma dll(msvcrt, system)

2. add the following line under it
int sscanf( LPSTR lpcszBuffer, LPCSTR lpcszFormat, ... );

This will give the prototype for Origin C compiler to connect to the proper function in the system library.

In the next service release, then the string.h will be the correct one. We must have a mismatch with our help system and the actually released header file.

CP




Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000