-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontainsStringSpecifier.c
More file actions
37 lines (33 loc) · 941 Bytes
/
containsStringSpecifier.c
File metadata and controls
37 lines (33 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* Header files goes here */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "main.h"
/**
* containsStringSpecifier - Checks if a string contains format specifiers.
*
* @input: The input string to check for format specifiers.
*
* Description:
* This function examines the input string to determine if it contains any
* format specifiers. Format specifiers are denoted by the '%' character
* followed by a valid specifier character, such as 's', 'd', 'f', or 'c'.
*
* If the input string contains one or more valid format specifiers, the
* function returns true; otherwise, it returns false.
*
* If the input is NULL, the function returns false to handle this case.
*
* Return: true if the string contains valid format specifiers,
* false otherwise.
*/
bool containsStringSpecifier(const char input)
{
if (input != '%')
{
/* code */
return (false);
}
return (true);
}