{"id":81465,"date":"2021-07-03T09:00:28","date_gmt":"2021-07-03T03:30:28","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=81465"},"modified":"2021-07-03T09:00:28","modified_gmt":"2021-07-03T03:30:28","slug":"strings-in-c","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/","title":{"rendered":"Strings in C"},"content":{"rendered":"<p>C programming language provides various features and techniques to the users and Strings is one of them. A string is generally a text that is enclosed in double quotes. C has a standard library called &lt;string.h&gt; which contains many functions and the main purpose of these functions is to perform complex operations on Strings.<\/p>\n<h3>What is String in C?<\/h3>\n<p>Strings are an array of characters. It is a one dimensional array. The only difference between a character array and a string is that the string is terminated with a null character \u2018\\0\u2019.<\/p>\n<p>The termination character(\u2018\\0\u2019) is the only important thing by which you can identify if it is string or not. You can represent the string using double quotes(\u201c\u201d). And, using single quotes(\u2018\u2019), you can represent a single character.<\/p>\n<h3>Declaration of Strings in C<\/h3>\n<p>String declaration is as simple as the declaration of a one-dimensional array. There are two ways to declare a string in C:-<\/p>\n<ul>\n<li>By char array<\/li>\n<li>By string literal<\/li>\n<\/ul>\n<p><strong>Example of declaring string by char array in C:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">char tutorial[10]={'T', 'e', 'c', 'h', 'V', 'i', 'd', 'v', 'a', 'n', '\\0'};\n\n<\/pre>\n<p><strong>Note:-<\/strong> While declaring, size is not mandatory.<\/p>\n<p>We can also declare the above string like below!<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">char tutorial[]={'T', 'e', 'c', 'h', 'V', 'i', 'd', 'v', 'a', 'n', '\\0'};\n<\/pre>\n<p><strong>Example of declaring string by string literal in C:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">char tutorial[]=\"TechVidvan\";\n<\/pre>\n<p>In the above case, the compiler will add a null character(\u2018\\0\u2019) at the end of the string.<\/p>\n<p><strong>Syntax:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">char name_str[size];<\/pre>\n<p>In the above expression, function name is name_str and size is the length of the characters.<\/p>\n<h3>Initialization of a string in C<\/h3>\n<p>Strings can be initialized in different ways. Below are some examples of string initialization.<\/p>\n<p><strong>Example:- Initializing a string in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">char str[] = \"Tech\";\nchar str[50] = \"TechVidvan\";\nchar str[] = {'T','e','c','h','V','i','d','v','a','n','\\0'};\n<\/pre>\n<p><strong>Memory representation of string \u201cTech\u201d:-<\/strong><\/p>\n<table style=\"height: 72px\" width=\"320\">\n<tbody>\n<tr>\n<td><b>T<\/b><\/td>\n<td><b>e<\/b><\/td>\n<td><b>c<\/b><\/td>\n<td><b>h<\/b><\/td>\n<td><b>\\0<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">\u00a0 0<\/span> <span style=\"font-weight: 400\"> \u00a0 \u00a0 \u00a0 \u00a0 1<\/span> <span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 2<\/span> <span style=\"font-weight: 400\"> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 3<\/span> <span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 4<\/span><\/p>\n<p><strong>Basic Example of initializing and declaring a string:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n\nint main() {\n  char s[]=\"TechVidvan!\";\n  printf(\"%s\",s);\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">TechVidvan!<\/div>\n<p>You can use the %s access specifier to directly read or print strings.<\/p>\n<h3>Assigning values to String in C<\/h3>\n<p>In strings, you can assign values to the string like below:-<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">char s[30] = \"TechVidvan\";\n<\/pre>\n<h4>Read a string in C:<\/h4>\n<p>We can use functions like scanf(), fgets(), gets() to read a string from the user.<\/p>\n<p><strong>Example:- Reading a string in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n\nint main() {\n  char s[10];\n  printf(\"Enter your name: \\n\");\n  scanf(\"%s\",s);\n  printf(\"Your name is: %s\",s);\n  return 0;\n}\n<\/pre>\n<p>In the above code, we use scanf() function to read string from the user and we use %s format specifier without using \u201c&amp;\u201d because an array acts as a pointer.<\/p>\n<p>The main problem with scanf() function is that it never reads the entire string in C. It will break the process as soon as whitespace, form feed, vertical tab or newline occurs.<\/p>\n<p>For example, suppose you want to read <strong>\u201cTechVidvan Tutorials\u201d<\/strong> and if you use scanf() then it will never read the entire string because whitespace is there between the two names. That\u2019s why the scanf() function will only read <strong>\u201cTechVidvan\u201d<\/strong>.<\/p>\n<h4>gets() function in C<\/h4>\n<p>But you can bypass this with the help of gets() function. With the help of this function, you can read the entire string. It ignores whitespaces and stops reading when a newline is entered.<\/p>\n<p><strong>Example:- gets() function in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n\nint main() {\n  char s[10];\n  printf(\"Enter your name: \\n\");\n  gets(s);\n  printf(\"Your name is: %s\",s);\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Enter your name:<br \/>\nYour name is: Raj Prasad<\/div>\n<p>But there is a dangerous problem in the get() function also. The gets() function continues reading until it finds a newline or encounters EOF and may overflow the bounds of the buffer it was given.<\/p>\n<p>Alternative to this, you can use the fgets() function to bypass the above situation.<\/p>\n<p><strong>Example:- fgets() function in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n\nint main() {\n  char s[15];\n  printf(\"Enter your name: \\n\");\n  fgets(s,15,stdin);\n  printf(\"Your name is: %s\",s);\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Enter your name:<br \/>\nYour name is: Raj Prasad<\/div>\n<p>The arguments that fgets() function accept are:-<br \/>\nThe string name.<br \/>\nNumber of characters to read.<br \/>\nstdin:- Purpose of this is to read from standard input which is from the keyboard.<\/p>\n<h3>Print a string in C<\/h3>\n<p>You already know that printf() function is used for printing strings in C. And with printf(), you have to use %s format specifier to print the string.<\/p>\n<p><strong>Example:- Printing a string in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">printf(\"%s\", str_name);<\/pre>\n<p>Apart from this function, you can also use fputs(), puts() function to print the string.<\/p>\n<h4>fputs() function in C:-<\/h4>\n<p>This function helps you in printing the string to the display.<\/p>\n<p><strong>Example:- fputs() function in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n\nint main() {\n  char tutorial[25];\n  printf(\"Enter your favourite website to learn C: \\n\");\n  fgets(tutorial,25,stdin);\n  fputs(tutorial,stdout);\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Enter your favourite website to learn C:<br \/>\nIt&#8217;s TechVidvan!<\/div>\n<p>The arguments that fgets() function accept are:-<\/p>\n<ul>\n<li>Name of the string.<\/li>\n<li><strong>stdout<\/strong>:- The purpose of this is to print the output to the screen.<\/li>\n<\/ul>\n<h4>puts() function in C<\/h4>\n<p>The puts() function helps you in printing the string to the display.<\/p>\n<p><strong>Example:- puts() function in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nint main() {\n  char str_name[25];\n  printf(\"Enter your favourite Food: \\n\");\n  fgets(str_name,25,stdin);\n  puts(str_name);\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Enter your favourite Food:<br \/>\nBiryani!<\/div>\n<h3>Passing strings to function in C<\/h3>\n<p>You can pass strings to the function in a similar way as you pass arrays to a function.<\/p>\n<p><strong>Example:- Passing strings to function<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nvoid display_string(char best_tutorial[]){\n  printf(\"Best Website to learn C programming is: %s\",best_tutorial);\n}\nint main() {\n  char best_tutorial[] = \"TechVidvan!\";\n  display_string(best_tutorial);\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Best Website to learn C programming is: TechVidvan!<\/div>\n<p>You can use pointers to point to the string which you want to print. There are several benefits of using pointers to point to the string.<\/p>\n<h3>Strings and Pointers in C<\/h3>\n<p>Strings and pointers are one of the most important and useful topics in the C programming language. You can use a pointer with a string like you use a pointer with an array.<\/p>\n<p><strong>Example:- Strings and Pointers in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nint main() {\n  char str_name[] = \"TechVidvan Tutorials: Strings and Pointers!\";\n  char *point = str_name;\n  printf(\"%s\",point);\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">TechVidvan Tutorials: Strings and Pointers!<\/div>\n<p>In the above example, point is declared as a pointer to the array of characters str_name. You cannot just copy the string into another string. For that, you will have to use a pointer to store the string. In the above example, we used a pointer to copy the string into another.<\/p>\n<h3>Traversing String in C<\/h3>\n<p>Strings traversing is one of the most important concepts in any programming language. Suppose, you want to manipulate a large text then string traversing will help you to manipulate the text.<\/p>\n<p>There are two ways to traverse a string in C:-<\/p>\n<ul>\n<li>Using the length of the string.<\/li>\n<li>Using the null character.<\/li>\n<\/ul>\n<p>Let us see an example of each:<\/p>\n<p><strong>Example of using the length of the string:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;  \nvoid main ()  \n{  \nchar str_name[20] = \"TechVidvan\";  \nint each = 0;   \nint incr = 0;  \nwhile(each&lt;11)  \n{  \nif(str_name[each]=='a' || str_name[each] == 'e' || str_name[each] == 'i' || str_name[each] == 'u' || str_name[each] == 'o')  \n{  \nincr++;  \n}  \neach++;  \n}  \nprintf(\"Number of vowels in '%s' is: %d\",str_name,incr);  \n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Number of vowels in &#8216;TechVidvan&#8217; is: 3<\/div>\n<p><strong>Example of Using the null character in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;  \nvoid main ()  \n{  \nchar str_name[20] = \"TechVidvan\";  \nint each = 0;   \nint incr = 0;  \nwhile(str_name[each] != NULL)  \n{  \nif(str_name[each]=='a' || str_name[each] == 'e' || str_name[each] == 'i' || str_name[each] == 'u' || str_name[each] == 'o')  \n{  \nincr++;  \n}  \neach++;  \n}  \nprintf(\"Number of vowels in '%s' is: %d\",str_name,incr);  \n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Number of vowels in &#8216;TechVidvan&#8217; is: 3<\/div>\n<h3>String functions in C<\/h3>\n<p>You often need to manipulate large texts according to the required problem. Doing this manually will make your programming complex and large.<\/p>\n<p>To get rid of this, C supports various string handling functions in the standard library <strong>\u201cstring.h\u201d<\/strong>.<\/p>\n<p><strong>Below are the string handling functions that C supports:-<\/strong><\/p>\n<ul>\n<li><strong>strcpy(s1, s2):-<\/strong> Copies string s2 into string s1.<\/li>\n<li><strong>strcat(s1, s2):-<\/strong> Concatenates string s2 onto the end of string s1.<\/li>\n<li><strong>strlen(s1):-<\/strong> Returns the length of string s1.<\/li>\n<li><strong>strcmp(s1,<\/strong> <strong>s2):-<\/strong> Compares string s1 and s2.<\/li>\n<li><strong>strlwr(s1):-<\/strong> Converts string s1 to lowercase.<\/li>\n<li><strong>strupr(s1):-<\/strong> Converts string s1 to uppercase.<\/li>\n<li><strong>strchr(s1, ch):-<\/strong> Returns a pointer to the first occurrence of character ch in string s1.<\/li>\n<li><strong>strstr(s1, s2):-<\/strong> Returns a pointer to the first occurrence of string s2 in string s1.<\/li>\n<li><strong>strrev(s1):-<\/strong> Reverse the string s1.<\/li>\n<li><strong>strncmp(s1, s2, n):-<\/strong> It returns greater than 0 if s1&gt;s2. And it returns less than 0 if s1&lt;s2. It returns 0 if the first n characters of s1 is equal to the first n characters of s2.<\/li>\n<li><strong>strncpy(s1, s2, n):-<\/strong> Copies the first n characters of s2 to s1.<\/li>\n<li><strong>strncat(s1, s2, n):-<\/strong> Concatenates first n characters of s2 to the end of s1.<\/li>\n<\/ul>\n<p><strong>Exam<\/strong><strong>ple:- String Handling Functions in C<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n#include &lt;string.h&gt;\nint main () {\nchar s1[20] = \"Greeting from \";\nchar s2[20] = \"TechVidvan!\";\nchar s3[20];\nint len;\nint cmp;\nstrcpy(s3, s1); \/\/ copies string s1 into s3!\nprintf(\"Coping string s1 into s3: %s\\n\", s3 );\nstrcat( s1, s2); \/\/ concatenates s1 and s2!\nprintf(\"Concatenating string s1 and s2: %s\\n\", s1 );\nlen = strlen(s1); \/\/ length of string s1\nprintf(\"Length of string s1 is: %d\\n\", len );\n\/\/ comparing string s1 and s2!\ncmp = strcmp(s1,s2);\nif (cmp == 0){\n  printf(\"String s1 and s2 are equal!\\n\");\n}\nelse{\n  printf(\"String s1 and s2 are not equal!\\n\");\n}\nreturn 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Coping string s1 into s3: Greeting from<br \/>\nConcatenating string s1 and s2: Greeting from TechVidvan!<br \/>\nLength of string s1 is: 25<br \/>\nString s1 and s2 are not equal!<\/div>\n<p><strong>Note:<\/strong>&#8211; You have to include <strong>\u201c#include &lt;string.h&gt;\u201d<\/strong> to run string handling functions.<\/p>\n<h3>Converting string to number in C<\/h3>\n<p>In C, stdio.h library contains the functions which help in converting a string to a number. Following are the functions:-<\/p>\n<ul>\n<li><strong>int atoi(string):-<\/strong> Mainly used to convert a string to the equivalent int value. It stands for ASCII to integer.<\/li>\n<li><strong>double atof(string):-<\/strong> Mainly used to convert a string to the equivalent double value. It stands for ASCII to float.<\/li>\n<li><strong>long int aol(string):-<\/strong> Mainly used to convert a string to the equivalent long integer value.<\/li>\n<\/ul>\n<p><strong>Example:- Converting string to a number<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n#include &lt;string.h&gt;\n#include &lt;stdlib.h&gt;\nint main(){\n  char str_id[10]=\"TechVidvan\";\n  int num;\n  num = atoi(str_id);\n  printf(\"Integer Value: %d\\n\",num);\n  char str_id_1[10]=\"5555555\";\n  int num1;\n  num1 = atoi(str_id_1);\n  printf(\"Integer Value: %d\\n\",num1);\n  return 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Integer Value: 0<br \/>\nInteger Value: 5555555<\/div>\n<p><strong>Note:-<\/strong> If you declare a string like <strong>char *string = \u201cHi\u201d<\/strong>. Then this is a constant and you can\u2019t modify it.<\/p>\n<h3>Summary<\/h3>\n<p>You must declare or initialize a string before using it. A string is an array of characters. You cannot say that \u2018A\u2019 is a string. It is a character. C supports various string handling functions which helps you in manipulating large texts. To use these functions, you have to include the <strong>string.h<\/strong> library. In C, we can convert strings to numbers which is useful for coding and decoding processes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C programming language provides various features and techniques to the users and Strings is one of them. A string is generally a text that is enclosed in double quotes. C has a standard library&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":81683,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3510],"tags":[3720,3721,3722,3696,3723],"class_list":["post-81465","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-converting-string-to-number-in-c","tag-string-functions-in-c","tag-strings-and-pointers-in-c","tag-strings-in-c","tag-traversing-string-in-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Strings in C - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn what are strings in C with Examples. learn how to convert string to number and traversing string in C.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Strings in C - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn what are strings in C with Examples. learn how to convert string to number and traversing string in C.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-03T03:30:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/String-in-c.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Strings in C - TechVidvan","description":"Learn what are strings in C with Examples. learn how to convert string to number and traversing string in C.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Strings in C - TechVidvan","og_description":"Learn what are strings in C with Examples. learn how to convert string to number and traversing string in C.","og_url":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-07-03T03:30:28+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/String-in-c.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Strings in C","datePublished":"2021-07-03T03:30:28+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/"},"wordCount":1467,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/String-in-c.jpg","keywords":["Converting string to number in C","String functions in C","Strings and Pointers in C","Strings in C","Traversing String in C"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/strings-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/","url":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/","name":"Strings in C - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/String-in-c.jpg","datePublished":"2021-07-03T03:30:28+00:00","description":"Learn what are strings in C with Examples. learn how to convert string to number and traversing string in C.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/strings-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/String-in-c.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/String-in-c.jpg","width":1200,"height":628,"caption":"String in c"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/strings-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Strings in C"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=81465"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81465\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/81683"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=81465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=81465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=81465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}