Home > Back-end >  How C an array directly into a string into an array, like python STR (), the eval?
How C an array directly into a string into an array, like python STR (), the eval?

Time:03-02

Use the python
A=[' a ', 'b', 'c']
B=STR (a)
A=eval (b)

CodePudding user response:

 # include & lt; stdio.h> 
Int main () {
Char a [3]={' a ', 'b', 'c'};
Char b [14]. Sprintf (" [' % c ', '% c', '% c'] ", a [0], a [1], a [2]).
Sscanf (b, "[' % c ', '% c', '% c']", & amp; A [0], & amp; A [1], & amp; A, [2]).
return 0;
}

CodePudding user response:

C + + character array is the string?

CodePudding user response:


Method is the source embedded in the python parser project all compiled,
Learning c + + in c + +, and don't always think about how python can how,
  • Related