Memory Allocation Functions in C

This C Tutorial explains Different Memory Functions in C and Explain Their Use with Examples. String handling functions, as we have seen, deal only with string-data. Then what about the processing of Non-String data, for example, an array of floats, an array of structures, an array of pointers etc.. Further, it’s not uncommon for non-string … Read more

advertisement

Explain Library Functions that Operate on Characters with Examples

Question: What are Different Functions in libc Which Operate on Characters? Answer: C library provides two groups of functions which operate on characters and these are prototyped in header . Two groups are: 1. Character classification functions 2. Character transformation functions Character classification functions, for example, int islower(int); int isupper(int); int iscntrl(int); int isdigit(int); int … Read more

advertisement

How are Errors Reported in a C Program When Operating System Fails to Perform some Requested Job

Question: How are Errors Reported When Operating System Fails to Perform some Requested Job in a C Program? Answer: In fact, we write C programs and request, for example, open a file for writing into it, to execute a some command etc., with Operating System and O.S., then, attempts to perform the requested work for … Read more

advertisement

strtok() Function in C with Examples

This Tutorial explains strtok() Function in C programming with examples. Strings in C comprise of individual parts separated by one or more characters called delimiters. These individual parts are called tokens. In order to process these individual parts, they have to be extracted from the string. That’s what strtok() function does. Empty string doesn’t have … Read more

advertisement

Difference between Basic and Advanced String Searching in C

Question: What is Difference Between Basic and Advanced String Searching in C? Answer: ANSI C provides several string functions for locating characters, any of a group of characters or locating and extracting individual sub-strings in a given string. Let’s consider, firstly, basic string searching functions, Finding a character: To locate a single character with its … Read more

advertisement

Restricted vs Unrestricted String Function in C

This C Tutorial explains Unrestricted and Length-Restricted String Functions in C with examples. Standard C library provides several string handling functions for performing various operations on strings. These functions are categorised into Length-Unrestricted and Length-Restricted functions. To use functions in a C program, include ‘‘ header which contains prototypes for both types of functions. In … Read more

advertisement

Difference between strlen() and sizeof() for String in C

Question: What is Difference Between Determining Length of a String and Character Array using sizeof Operator and strlen() Function in C Programming Language? Answer: Let’s recall, firstly, concept of sizeof operator and strlen() functions before we implement them with character arrays or strings. sizeof operator returns amount of memory allocated, in bytes, of the argument … Read more

advertisement

Difference between Character Array and String in C

Question: What is Difference Between Character Array and String Literal in C Language? Answer: Let’s, first, consider following declarations, #define STR_LIT "I’m string literal declared using #define" char *str_lit = "I’m string literal declared through pointer-to-char"; char char_arr[5] = {’a’,’b’,’c’,’d’,’e’}; /* character array */ Let’s, now, embed them into a program below, /* * diff_chararr_strlit.c … Read more

advertisement

Difference between Character and String in C

Question: What is Difference Between a Character and a String in C? Answer: A character is just a single character enclosed in single quotes. For example: char initial = ‘A’; /* initial declared to be a character */ And a character string is a sequence of 0 or more characters enclosed in double quotes. Each … Read more

advertisement

NULL Character in C with Examples

This C Tutorial explains NULL Character in C with examples. In C programming, character strings are terminated by NULL Byte. The representation for NULL Byte is ‘\0’ or ‘0’ (zero) or NULL. This way we wouldn’t be able to use NULL character in ours’ strings. Then why NULL character and not any other is used … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.