You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
printf is a c function which prints a format string with some arguments to stdout.
For this challenge, your task is to implement the Printf type which takes a format string as the first generic argument, and an array of arguments as the second generic argument.
Printf must follow a couple of rules.
%d | %s | %b wildcards must be replaced with the appropriate type arguments.
1.1 %d replaced with number
1.2 %s replaced with string
1.3 %b replaced with boolean
%% must be escaped to a single %.
Number of wildcards and arguments must be the same; else never.
Info
Basic info of your challenge questions,
Question
printf
is ac
function which prints a format string with some arguments tostdout
.For this challenge, your task is to implement the
Printf
type which takes a format string as the first generic argument, and an array of arguments as the second generic argument.Printf
must follow a couple of rules.%d | %s | %b
wildcards must be replaced with the appropriate type arguments.1.1
%d
replaced withnumber
1.2
%s
replaced withstring
1.3
%b
replaced withboolean
%%
must be escaped to a single%
.never
.Example:
Template
Test Cases
Solution:
The text was updated successfully, but these errors were encountered: