0% found this document useful (0 votes)
24 views

Data Types

Data types in c

Uploaded by

dedmond030
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Data Types

Data types in c

Uploaded by

dedmond030
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Datatypes in C

July 3, 2024
This conversation may reflect the link creator’s personalized data, which isn’t shared and can
meaningfully change how the model responds.
datatypes in c

In C programming, data types specify the type of data that a variable can hold. C provides
several built-in data types, which can be categorized into the following groups:

1. Basic Data Types:


o int: Used to store integers (whole numbers). Size and range depend on the
system architecture (typically 4 bytes on 32-bit and 64-bit systems).
o char: Used to store single characters. It typically requires 1 byte of memory.
o float: Used to store floating-point numbers (numbers with a fractional part).
Typically requires 4 bytes of memory.
o double: Used to store double-precision floating-point numbers. Typically
requires 8 bytes of memory.
2. Derived Data Types:
o Arrays: Collection of elements of the same type. For example, int arr[10]
is an array of 10 integers.
o Pointers: Variables that store the address of another variable. For example,
int *ptr is a pointer to an integer.
o Structures: User-defined data types that group different types of variables.
Defined using the struct keyword.
o Unions: Similar to structures, but members share the same memory location.
Defined using the union keyword.
o Enums: Enumeration types that assign names to a set of integer values.
Defined using the enum keyword.
3. Void Data Type:
o void: Represents the absence of type. Commonly used for functions that do
not return a value or for generic pointers (void *).
4. Modifiers:
o Signed: Default modifier for integer types, allowing both positive and
negative values. For example, signed int.
o Unsigned: Modifier for integer types, allowing only positive values. For
example, unsigned int.
o Short: Modifier for integer types, typically reducing their size. For example,
short int.
o Long: Modifier for integer types, typically increasing their size. For example,
long int or long long int.

Example of Usage:
c
Copy code
#include <stdio.h>
int main() {
int integerVar = 100;
char charVar = 'A';
float floatVar = 10.5f;
double doubleVar = 20.123456;
int arr[5] = {1, 2, 3, 4, 5};
int *ptr = &integerVar;

struct Person {
char name[50];
int age;
};

struct Person person1 = {"John Doe", 30};

union Data {
int intData;
float floatData;
char charData;
};

union Data data;


data.intData = 10;

enum Weekday { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday,


Saturday };
enum Weekday today = Wednesday;

printf("Integer: %d\n", integerVar);


printf("Character: %c\n", charVar);
printf("Float: %f\n", floatVar);
printf("Double: %lf\n", doubleVar);
printf("Array element: %d\n", arr[2]);
printf("Pointer to integer: %d\n", *ptr);
printf("Person name: %s, age: %d\n", person1.name, person1.age);
printf("Union data (int): %d\n", data.intData);
printf("Today is day number: %d\n", today);

return 0;
}

This example demonstrates the use of various data types and their associated features in C.

signed int size

The size of a signed int in C depends on the system and the compiler being used. However,
there are some general conventions:

1. Typical Size on Most Systems:


o On most modern systems, including 32-bit and 64-bit systems, a signed int
is typically 4 bytes (32 bits) in size.
2. Range:
o For a 4-byte signed int, the range is from -2,147,483,648 to
2,147,483,647.

To find the size of a signed int on your specific system, you can use the sizeof operator in
C:
c
Copy code
#include <stdio.h>

int main() {
printf("Size of signed int: %zu bytes\n", sizeof(signed int));
return 0;
}

When you run this code, it will print the size of a signed int on your system.

functions, arguments , passing value and reference


ChatGPT

In C programming, functions are blocks of code that perform a specific task. Functions can
take arguments (also known as parameters) and can return a value. There are two primary
ways to pass arguments to functions: by value and by reference.

Functions in C

A function in C is defined using the following syntax:

c
Copy code
return_type function_name(parameter_list) {
// function body
}

Example Function Definition and Declaration:


c
Copy code
#include <stdio.h>

// Function declaration (prototype)


void greet(char name[]);

int main() {
// Function call
greet("Alice");
return 0;
}

// Function definition
void greet(char name[]) {
printf("Hello, %s!\n", name);
}

Passing Arguments to Functions

1. Pass by Value:
o When an argument is passed by value, a copy of the actual value is passed to
the function. Changes made to the parameter inside the function do not affect
the original value.
c
Copy code
#include <stdio.h>

void increment(int a);

int main() {
int x = 10;
printf("Before increment: %d\n", x);
increment(x);
printf("After increment: %d\n", x);
return 0;
}

void increment(int a) {
a = a + 1;
printf("Inside function: %d\n", a);
}

Output:

yaml
Copy code
Before increment: 10
Inside function: 11
After increment: 10

2. Pass by Reference:
o When an argument is passed by reference, the address of the actual value is
passed to the function. This allows the function to modify the original value.

c
Copy code
#include <stdio.h>

void increment(int *a);

int main() {
int x = 10;
printf("Before increment: %d\n", x);
increment(&x);
printf("After increment: %d\n", x);
return 0;
}

void increment(int *a) {


*a = *a + 1;
printf("Inside function: %d\n", *a);
}

Output:

yaml
Copy code
Before increment: 10
Inside function: 11
After increment: 11
Explanation:

1. Pass by Value:
o In the first example, the increment function receives a copy of x as its
argument. Modifying a inside the function does not change the original value
of x in the main function.
2. Pass by Reference:
o In the second example, the increment function receives the address of x. The
*a notation is used to access and modify the value stored at that address. Thus,
the original value of x is changed.

Using Pointers for Passing by Reference:

 Pointers are used to pass arguments by reference. The pointer variable holds the
address of the variable to be passed.
 Dereferencing the pointer (using the * operator) allows access to the actual value
stored at the address.

Conclusion:

 Pass by value is useful when you do not want the function to modify the original
argument.
 Pass by reference is useful when you want the function to modify the original
argument, or when you need to pass large amounts of data without copying.

Understanding these concepts allows for more flexible and efficient function usage in C
programming.

Arrays & Strings in C


July 4, 2024
This conversation may reflect the link creator’s personalized data, which isn’t shared and can
meaningfully change how the model responds.
array and strings in embedded c
ChatGPT

In embedded C programming, working with arrays and strings is common and essential for
various applications, from handling sensor data to managing user input and display outputs.
Here is an overview of how to work with arrays and strings in embedded C.

Arrays
An array is a collection of elements of the same data type, stored in contiguous memory
locations. Arrays can be of any data type, including int, char, float, etc.
Declaring and Initializing Arrays

Declaration:

c
Copy code
int array_name[size];

Initialization:

c
Copy code
int array_name[5] = {1, 2, 3, 4, 5};

Accessing Array Elements

Array elements are accessed using their index, starting from 0.

c
Copy code
int value = array_name[2]; // Access the third element

Example: Array in Embedded C


c
Copy code
#include <stdio.h>

int main() {
int sensor_readings[5] = {10, 20, 30, 40, 50};

for(int i = 0; i < 5; i++) {


printf("Sensor reading %d: %d\n", i, sensor_readings[i]);
}

return 0;
}

Strings
In C, strings are arrays of characters ending with a null character ('\0'). This null character
marks the end of the string.

Declaring and Initializing Strings

Declaration:

c
Copy code
char str[size];

Initialization:
c
Copy code
char str[6] = "Hello";

Accessing String Characters

String characters can be accessed using array indexing.

c
Copy code
char c = str[1]; // Access the second character, which is 'e'

Example: String in Embedded C


c
Copy code
#include <stdio.h>

int main() {
char greeting[6] = "Hello";

printf("Greeting: %s\n", greeting);

// Print each character


for(int i = 0; i < 5; i++) {
printf("Character %d: %c\n", i, greeting[i]);
}

return 0;
}

Common String Functions

C provides a set of functions to manipulate strings in the string.h library.

 strlen(): Returns the length of the string.


 strcpy(): Copies one string to another.
 strcat(): Concatenates two strings.
 strcmp(): Compares two strings.

Example: Using String Functions


c
Copy code
#include <stdio.h>
#include <string.h>

int main() {
char str1[20] = "Hello";
char str2[20] = "World";

// String length
printf("Length of str1: %lu\n", strlen(str1));

// String copy
strcpy(str2, str1);
printf("str2 after strcpy: %s\n", str2);

// String concatenation
strcat(str1, " ");
strcat(str1, str2);
printf("str1 after strcat: %s\n", str1);

// String comparison
if(strcmp(str1, str2) == 0) {
printf("str1 and str2 are equal\n");
} else {
printf("str1 and str2 are not equal\n");
}

return 0;
}

Summary
 Arrays are collections of elements of the same type.
 Strings are arrays of characters ending with a null character.
 Arrays and strings are accessed using indexing.
 string.h provides useful functions for string manipulation.

By understanding and using arrays and strings, you can effectively manage data and perform
various operations in embedded C programming.

pointers in c
ChatGPT

Pointers are a powerful feature in C that provide a way to directly access and manipulate
memory addresses. They are essential for dynamic memory allocation, array handling, and
efficient function arguments.

Basics of Pointers
A pointer is a variable that stores the memory address of another variable.

Declaring Pointers

To declare a pointer, you specify the type of data the pointer will point to, followed by an
asterisk (*).

c
Copy code
int *ptr; // Pointer to an integer
char *cptr; // Pointer to a character

Initializing Pointers

You can initialize a pointer by assigning it the address of another variable using the address-
of operator (&).
c
Copy code
int var = 10;
int *ptr = &var; // ptr now holds the address of var

Dereferencing Pointers

Dereferencing a pointer means accessing the value stored at the memory address the pointer
points to, using the dereference operator (*).

c
Copy code
int value = *ptr; // value is now 10

Example: Basic Pointer Usage


c
Copy code
#include <stdio.h>

int main() {
int var = 10;
int *ptr = &var;

printf("Value of var: %d\n", var);


printf("Address of var: %p\n", (void*)&var);
printf("Value of ptr: %p\n", (void*)ptr);
printf("Value pointed to by ptr: %d\n", *ptr);

return 0;
}

Pointer Arithmetic
Pointers can be incremented or decremented to point to the next or previous memory location
of the same type.

c
Copy code
int arr[5] = {1, 2, 3, 4, 5};
int *ptr = arr;

printf("First element: %d\n", *ptr); // 1


ptr++;
printf("Second element: %d\n", *ptr); // 2

Pointers and Arrays


Arrays and pointers are closely related. The name of an array is a pointer to its first element.

c
Copy code
int arr[5] = {1, 2, 3, 4, 5};
int *ptr = arr; // ptr points to the first element of arr
for (int i = 0; i < 5; i++) {
printf("Element %d: %d\n", i, *(ptr + i));
}

Pointers to Pointers
You can have pointers that point to other pointers.

c
Copy code
int var = 10;
int *ptr = &var;
int **pptr = &ptr;

printf("Value of var: %d\n", var);


printf("Value pointed to by ptr: %d\n", *ptr);
printf("Value pointed to by pptr: %d\n", **pptr);

Function Pointers
Function pointers can be used to store the address of functions and invoke them.

Declaring Function Pointers


c
Copy code
void (*func_ptr)();

Example: Using Function Pointers


c
Copy code
#include <stdio.h>

void say_hello() {
printf("Hello, World!\n");
}

int main() {
void (*func_ptr)() = say_hello;

func_ptr(); // Call the function via the function pointer

return 0;
}

Dynamic Memory Allocation


Pointers are essential for dynamic memory allocation using functions like malloc, calloc,
and free.

Example: Dynamic Memory Allocation


c
Copy code
#include <stdio.h>
#include <stdlib.h>

int main() {
int *ptr = (int*) malloc(5 * sizeof(int));

if (ptr == NULL) {
printf("Memory allocation failed\n");
return 1;
}

for (int i = 0; i < 5; i++) {


ptr[i] = i + 1;
printf("Element %d: %d\n", i, ptr[i]);
}

free(ptr); // Free the allocated memory

return 0;
}

Summary
 Pointers store memory addresses of variables.
 The address-of operator (&) gets the address of a variable.
 The dereference operator (*) accesses the value at the pointer's address.
 Pointers can be used for dynamic memory allocation, efficient function arguments,
and more.
 Function pointers can store and call functions.

Understanding pointers is crucial for effective C programming, especially in embedded


systems where memory management is critical.

pointers using strings


ChatGPT

Working with pointers and strings in C is fundamental and powerful. Strings in C are arrays
of characters, and pointers can be used to manipulate these arrays efficiently. Let's explore
various aspects of using pointers with strings in C.

Basics of Strings with Pointers


A string in C is a sequence of characters terminated by a null character ('\0').

Declaring and Initializing Strings

Strings can be declared as arrays or as pointers.

Array Declaration:

c
Copy code
char str[] = "Hello, World!";

Pointer Declaration:

c
Copy code
char *str = "Hello, World!";

Accessing String Elements Using Pointers

You can access individual characters in a string using a pointer.

c
Copy code
char *str = "Hello, World!";
printf("First character: %c\n", *str); // H
printf("Second character: %c\n", *(str + 1)); // e

Traversing a String Using Pointers

You can traverse a string using a pointer.

c
Copy code
#include <stdio.h>

int main() {
char *str = "Hello, World!";
char *ptr = str;

while (*ptr != '\0') {


printf("%c", *ptr);
ptr++;
}

printf("\n");

return 0;
}

Modifying Strings Using Pointers


When a string is declared as an array, you can modify its contents. However, if it's declared
as a pointer to a string literal, it is typically stored in read-only memory, and modifying it will
result in undefined behavior.

Modifiable String (Array Declaration):

c
Copy code
char str[] = "Hello, World!";
str[0] = 'h';
printf("%s\n", str); // hello, World!
Non-Modifiable String (Pointer to Literal):

c
Copy code
char *str = "Hello, World!";
// str[0] = 'h'; // This will cause a runtime error

Functions with String Pointers


You can pass strings to functions using pointers. This is efficient because only the address of
the string is passed, not the entire string.

Example: String Length Function


c
Copy code
#include <stdio.h>

int string_length(char *str) {


int length = 0;
while (*str != '\0') {
length++;
str++;
}
return length;
}

int main() {
char *str = "Hello, World!";
int len = string_length(str);
printf("Length of string: %d\n", len);

return 0;
}

Example: String Copy Function


c
Copy code
#include <stdio.h>

void string_copy(char *dest, char *src) {


while (*src != '\0') {
*dest = *src;
dest++;
src++;
}
*dest = '\0'; // Null-terminate the destination string
}

int main() {
char src[] = "Hello, World!";
char dest[20];

string_copy(dest, src);
printf("Copied string: %s\n", dest);
return 0;
}

Dynamic Memory Allocation for Strings


You can use dynamic memory allocation to create strings whose size is determined at
runtime.

Example: Dynamic Allocation


c
Copy code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
char *src = "Hello, World!";
int len = strlen(src);

// Allocate memory for the destination string


char *dest = (char*) malloc((len + 1) * sizeof(char));

if (dest == NULL) {
printf("Memory allocation failed\n");
return 1;
}

// Copy the string


strcpy(dest, src);

printf("Dynamically allocated string: %s\n", dest);

// Free the allocated memory


free(dest);

return 0;
}

Summary
 Strings in C are arrays of characters terminated by a null character.
 Pointers can efficiently manipulate strings.
 You can access and traverse strings using pointers.
 Modifiable strings should be declared as arrays, not as pointers to literals.
 Functions can use pointers to work with strings.
 Dynamic memory allocation allows for flexible string handling.

Understanding how to use pointers with strings is crucial for effective C programming,
especially in memory-constrained environments like embedded systems.

Embedded C structure and union


ChatGPT
In embedded C programming, structures and unions are essential for organizing and
managing data. They allow you to group different data types together, which can simplify
your code and make it more efficient.

Structures
A structure is a user-defined data type that groups different variables under a single name.
Each variable in a structure is called a member.

Declaring and Defining Structures

Declaration:

c
Copy code
struct StructureName {
dataType member1;
dataType member2;
// ...
};

Example:

c
Copy code
struct SensorData {
int temperature;
float humidity;
char status;
};

Creating Structure Variables

You can create variables of the structure type.

Example:

c
Copy code
struct SensorData sensor1;

Accessing Structure Members

Structure members are accessed using the dot (.) operator.

Example:

c
Copy code
sensor1.temperature = 25;
sensor1.humidity = 60.5;
sensor1.status = 'A';
printf("Temperature: %d\n", sensor1.temperature);
printf("Humidity: %.1f\n", sensor1.humidity);
printf("Status: %c\n", sensor1.status);

Using Pointers with Structures

You can use pointers to structures to access and modify structure members.

Example:

c
Copy code
struct SensorData *ptr = &sensor1;

ptr->temperature = 30; // Using the arrow (->) operator


printf("Temperature via pointer: %d\n", ptr->temperature);

Example: Structure in Embedded C


c
Copy code
#include <stdio.h>

struct SensorData {
int temperature;
float humidity;
char status;
};

int main() {
struct SensorData sensor1;

sensor1.temperature = 25;
sensor1.humidity = 60.5;
sensor1.status = 'A';

printf("Temperature: %d\n", sensor1.temperature);


printf("Humidity: %.1f\n", sensor1.humidity);
printf("Status: %c\n", sensor1.status);

return 0;
}

Unions
A union is a user-defined data type similar to a structure. However, unlike structures, unions
store different data types in the same memory location. The size of the union is the size of its
largest member, and only one member can hold a value at any given time.

Declaring and Defining Unions

Declaration:

c
Copy code
union UnionName {
dataType member1;
dataType member2;
// ...
};

Example:

c
Copy code
union Data {
int integer;
float floatingPoint;
char character;
};

Creating Union Variables

You can create variables of the union type.

Example:

c
Copy code
union Data data1;

Accessing Union Members

Union members are accessed using the dot (.) operator, similar to structures.

Example:

c
Copy code
data1.integer = 10;
printf("Integer: %d\n", data1.integer);

data1.floatingPoint = 22.5;
printf("Floating Point: %.1f\n", data1.floatingPoint);

data1.character = 'A';
printf("Character: %c\n", data1.character);

Note: Assigning a value to one member of a union overwrites the previous value because all
members share the same memory location.

Example: Union in Embedded C


c
Copy code
#include <stdio.h>

union Data {
int integer;
float floatingPoint;
char character;
};

int main() {
union Data data1;

data1.integer = 10;
printf("Integer: %d\n", data1.integer);

data1.floatingPoint = 22.5;
printf("Floating Point: %.1f\n", data1.floatingPoint);

data1.character = 'A';
printf("Character: %c\n", data1.character);

return 0;
}

Summary
 Structures group different data types together, with each member having its own
memory location.
 Unions also group different data types, but all members share the same memory
location.
 Structures and unions are useful for organizing and managing related data in
embedded C programming.
 Pointers can be used with structures and unions for more flexible and efficient data
handling.

Understanding and using structures and unions effectively can greatly enhance your
embedded C programming skills, allowing for more organized, readable, and efficient code.

how to set a bit and clear a bit in embedded c


ChatGPT

In embedded C programming, manipulating individual bits is a common task, especially


when dealing with hardware registers and bitfields. To set or clear specific bits in a variable,
you can use bitwise operators. Here’s how you can do it:

Setting a Bit
To set a specific bit, you use the bitwise OR (|) operator with a bitmask that has the target bit
set to 1.

Formula to Set a Bit


c
Copy code
value |= (1 << bit_position);

Example: Setting a Bit


c
Copy code
#include <stdio.h>

int main() {
unsigned char value = 0x00; // Initial value: 00000000

int bit_position = 3; // Bit position to set (0-based index)


value |= (1 << bit_position); // Set bit 3

printf("Value after setting bit 3: 0x%02X\n", value); // Output: 0x08


(00001000)

return 0;
}

Clearing a Bit
To clear a specific bit, you use the bitwise AND (&) operator with a bitmask that has the
target bit set to 0 and all other bits set to 1. This is achieved by using the bitwise NOT (~)
operator.

Formula to Clear a Bit


c
Copy code
value &= ~(1 << bit_position);

Example: Clearing a Bit


c
Copy code
#include <stdio.h>

int main() {
unsigned char value = 0xFF; // Initial value: 11111111

int bit_position = 3; // Bit position to clear (0-based index)


value &= ~(1 << bit_position); // Clear bit 3

printf("Value after clearing bit 3: 0x%02X\n", value); // Output: 0xF7


(11110111)

return 0;
}

Combining Set and Clear Operations


You can create functions to encapsulate these operations for better code readability and reuse.

Example: Set and Clear Bit Functions


c
Copy code
#include <stdio.h>
// Function to set a bit
void set_bit(unsigned char *value, int bit_position) {
*value |= (1 << bit_position);
}

// Function to clear a bit


void clear_bit(unsigned char *value, int bit_position) {
*value &= ~(1 << bit_position);
}

int main() {
unsigned char value = 0x00; // Initial value: 00000000

set_bit(&value, 3); // Set bit 3


printf("Value after setting bit 3: 0x%02X\n", value); // Output: 0x08
(00001000)

clear_bit(&value, 3); // Clear bit 3


printf("Value after clearing bit 3: 0x%02X\n", value); // Output: 0x00
(00000000)

return 0;
}

Summary
 To set a bit, use the bitwise OR (|) operator with a bitmask: value |= (1 <<
bit_position).
 To clear a bit, use the bitwise AND (&) operator with a negated bitmask: value &=
~(1 << bit_position).
 Encapsulate bit manipulation operations in functions for better code readability and
reuse.

These techniques are crucial for tasks such as configuring hardware registers, setting flags,
and manipulating specific bits within a byte or word in embedded systems.

printf and sprintf formats in embedded c


ChatGPT

In embedded C programming, printf and sprintf are commonly used for formatting and
outputting strings. Understanding the formatting options available for these functions can
greatly enhance their utility in your applications.

printf Function
The printf function outputs formatted text to the standard output (typically the console or
terminal).

Basic Syntax
c
Copy code
printf("format string", arguments);

Common Format Specifiers

 %d or %i: Signed decimal integer


 %u: Unsigned decimal integer
 %x or %X: Unsigned hexadecimal integer
 %o: Unsigned octal integer
 %c: Character
 %s: String of characters
 %f: Floating-point number (decimal notation)
 %e or %E: Floating-point number (scientific notation)
 %g or %G: Floating-point number (use the shortest representation, either decimal or
scientific notation)
 %p: Pointer
 %%: Literal % character

Example: Using printf


c
Copy code
#include <stdio.h>

int main() {
int num = 42;
float pi = 3.14159;
char ch = 'A';
char str[] = "Hello, World!";

printf("Integer: %d\n", num);


printf("Hexadecimal: %x\n", num);
printf("Character: %c\n", ch);
printf("String: %s\n", str);
printf("Floating-point: %.2f\n", pi);

return 0;
}

Width and Precision Specifiers

 Width: Minimum number of characters to be printed. If the value to be printed is


shorter than this width, the result is padded with spaces.
 Precision: Specifies the number of digits to be printed after the decimal point for
floating-point numbers.

c
Copy code
printf("%8d\n", 123); // Output: " 123"
printf("%.2f\n", 3.14159); // Output: "3.14"

sprintf Function
The sprintf function works similarly to printf, but instead of sending the output to the
standard output, it writes the formatted string to a character array.

Basic Syntax
c
Copy code
sprintf(buffer, "format string", arguments);

Example: Using sprintf


c
Copy code
#include <stdio.h>

int main() {
char buffer[50];
int num = 42;
float pi = 3.14159;
char ch = 'A';
char str[] = "Hello, World!";

sprintf(buffer, "Integer: %d", num);


printf("%s\n", buffer);

sprintf(buffer, "Hexadecimal: %x", num);


printf("%s\n", buffer);

sprintf(buffer, "Character: %c", ch);


printf("%s\n", buffer);

sprintf(buffer, "String: %s", str);


printf("%s\n", buffer);

sprintf(buffer, "Floating-point: %.2f", pi);


printf("%s\n", buffer);

return 0;
}

Width and Precision Specifiers with sprintf

The width and precision specifiers work the same way with sprintf as they do with printf.

c
Copy code
#include <stdio.h>

int main() {
char buffer[50];

sprintf(buffer, "%8d", 123);


printf("'%s'\n", buffer); // Output: "' 123'"

sprintf(buffer, "%.2f", 3.14159);


printf("'%s'\n", buffer); // Output: "'3.14'"

return 0;
}

Summary
 printf: Outputs formatted text to the standard output.
 sprintf: Writes formatted text to a character array.
 Common format specifiers include %d, %x, %c, %s, %f, etc.
 Width and precision specifiers can control the formatting further.
 These functions are crucial for formatting and outputting strings in embedded C
programming.

Get started with ChatGPT

Report content|Terms of use|Privacy policy|


?

You might also like