How To Find A String In Dev C++

morning everyone.
i hope someone out there could really help me.
im trying to store large numbers. as i need to complete my work under Dev-c++ environment but im not familiar with it as i just started using it recently.
the following is my initial coding for my work.

  • I hope someone out there could really help me. Im trying to store large numbers. As i need to complete my work under Dev-c environment but im not familiar with it as i just started using it recently. The following is my initial coding for my work. /.This is a program to calculate large numbers.
  • Apr 29, 2010  Posted: Thu Apr 29, 2010 11:15 am Post subject: If using strings in dev-c I am using latest version of dev-c and i am trying to do an if with strings. So here's my code, i.
  • Apr 10, 2017  Fortunately, the C standard library provides users with a string class. C developers probably let out a sigh of relief, since they didn’t have to write implementations for the equals operator or the size method. Below is a very simple example of using a std::string class.

In this first example we declare a string and then use the string standard library find function to get the position of the first character of the substring in the parent string. This is the most straight forward way to find a substring and I would advise this approach if you are using a standard library string.

after i compile using Dev-C++, it shows this error description:
invalid conversion from 'char' to 'const char*'
initializing argument 1 of 'int atoi(const char*)'
i've tried all ways to modify my coding but i just cant get it.
really would be happy if someone could help me.
hope to receives some replies as soon as possible.thank you.

  • 4 Contributors
  • forum 5 Replies
  • 1,031 Views
  • 2 Days Discussion Span
  • commentLatest Postby pearlyLatest Post

Ancient Dragon5,243

My guess is the problem is in stack2.cpp. But since you did not post it there is no way to tell. Also please post the exact error message including file and line number

String length C program to find length of a string, for example, length of the string 'C programming' is 13 (space character is counted). The null character isn't counted when calculating it. To find it, we can use strlen function of 'string.h.' C program to find length of a string without using strlen function, recursion.

Length of string in C language

#include <stdio.h>

String In C

#include <string.h>

int main()
{
char a[100];
int length;

printf('Enter a string to calculate its lengthn');
gets(a);

length =strlen(a);

Find

printf('Length of the string = %dn', length);

return0;
}

Download String length program.

Output of program:

String length in C without strlen

You can also find string length without strlen function. We create our function to find it. We scan all the characters in the string if the character isn't a null character then increment the counter by one. Once the null character is found the counter equals the length of the string.

#include <stdio.h>

int main()
{
char s[1000];
int c =0;

printf('Input a stringn');
gets(s);

while(s[c]!='0')
c++;

printf('Length of the string: %dn', c);

return0;
}

Function to find string length:

int string_length(char s[])

C++ Find Substring In String

C# add two strings{
int c

How To Find A String In Dev C 2017

=0;

while(s[c]!='0')
c++;

return c;
}

C program to find length of a string using recursion

#include <stdio.h>

int string_length(char[],int);

int main()
{
char s[100];
int l =0;// Length is initialized to zero

C++ Std String Find

gets(s);

printf('Length = %dn', string_length(s, l));

return0;
}

int string_length(char s[],int l){
if(s[l]'0')// Base condition
return l;

l++;
return(string_length(s, l));
}

Function to find string length using pointers

int string_length(char*s){
int c =0;
while(*s[c]!='0')
c++;
return c;
}