Lists
Lists Lists: A list is a collection of items that are ordered and changeable. Lists are written with square brackets and each item is separated by a comma. Here is an example of a list with three items: my_list = [1, “hello”, True] In this example, my_list is a list that contains an integer, a […]
BUILT IN STRING METHOD
BUILT IN STRING METHOD Here is a table of commonly used built-in string methods in Python: Method Description str.upper() Returns a new string in all uppercase letters str.lower() Returns a new string in all lowercase letters str.capitalize() Returns a new string with the first letter capitalized str.title() Returns a new string with the first […]
Memory Management
Memory Management Memory management in C is an important concept for managing the allocation and deallocation of memory resources in your program. C provides several functions for allocating and freeing memory, including malloc, calloc, realloc, and free. The malloc function is used to allocate a block of memory on the heap. It takes a single […]
Preprocessors
Preprocessor In C, the preprocessor is a tool that performs text manipulation on the source code before it is compiled. It is responsible for tasks such as including header files, defining macros, and conditional compilation. The preprocessor directives start with the # character and are processed before the code is compiled. Here are some of […]
Typedef
Typedef In C, typedef is a keyword used to create a new type name that can be used as an alias for an existing data type. It is often used to simplify complex data types and make the code more readable and maintainable. Here is an example of using typedef: #include typedef int my_integer; int […]
Structure
Structure In C, a structure is a user-defined data type that groups together related data items of different data types. The structure provides a convenient way to represent complex data in a simple and organized way. Here is an example of a structure: #include struct student { char name[50]; int roll_no; float marks; }; int […]
Functions
Functions A function is a self-contained block of code that performs a specific task. Functions are used to break down a program into smaller, more manageable pieces, and also to reuse code throughout the program. A function can take input arguments and can also return a value. A function declaration is a statement that informs […]
Pointer
Pointer A pointer is a variable that stores the memory address of another variable. Pointers provide a way to manipulate and access memory directly, which can be useful for tasks such as dynamic memory allocation, passing parameters by reference, and implementing data structures such as linked lists. To declare a pointer variable in C, […]
String Functions
Strings Function Here’s a table of some commonly used string functions in C, along with a brief description of what they do: Function Description strlen() :Returns the length of a string, not including the terminating null character. strcpy():Copies a string from one location to another. strncpy():Copies a specified number of characters from one string to […]
Strings
Strigns In C programming language, a string is an array of characters that is terminated by a null character (‘’). Strings in C are represented using character arrays. To declare a string in C, you can use the following syntax: char string_name[length]; Here, string_name is the name of the string, and length is the maximum […]