You are here

What a format for sprintf need to use for print array? | Cypress Semiconductor

What a format for sprintf need to use for print array?

Summary: 3 Replies, Latest post by hli on 11 Mar 2016 02:09 AM PST
Verified Answers: 2
Last post
Log in to post new comments.
chaplin.u_1533771's picture
77 posts

I want to print array of this structure : 

typedef struct
    uint32 time;
    uint32 date;
    uint32 dayOfWeek;
    uint32 status;

What a format for sprintf need to use ?

sprintf(stringBuffer, "%??\r\n",  timeData[i] );

user_1377889's picture
9256 posts

You will have to print the elements of the struct or the members of the array step by step, no chance to print as a single item.



chaplin.u_1533771's picture
77 posts

In SKILL I use I can make print entire list :
(prop nil bBox ((13063.0 3402.5) (13357.5 3702.5)) readOnly t pins (dbid:360332064 dbid:360331984) objType "symbol" embeddedAttach nil embeddedMethod nil embeddedLayer nil embedded nil fixedByTestPoint nil component dbid:357473208 xy (13225.0 3555.0) type "PACKAGE" rotation 270.0 refdes "D26" parent dbid:278137888 name "SMB_CP" definition dbid:357533128 mirrorType "NO" isMirrored nil etchChildren nil children (dbid:360924432 dbid:360924512 dbid:360811176 dbid:360924704 dbid:360924592 dbid:360924648 dbid:360924960 dbid:360925032 dbid:360925104 dbid:360925176 dbid:360925248 dbid:360925320 dbid:360925392 dbid:360925464 dbid:360925536 dbid:360925608 dbid:360925680 dbid:360925752) parentGroups nil)

that include all properties of object with different types...

Nothing like this ?? Very bad :(

user_78878863's picture
2551 posts

PSoCs are programmed in C, and C is not a high-level language. Apart from that, a small 'for'-loop with a printf-statement in it seems much easier than the code you pasted here :)

Log in to post new comments.