strlen

i have a program that designed to count the characters,but whenever i put space on it, it only counts the character before the space.. how can i resolve this??
you share with us your code.

size_t strlen ( const char * str );
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <string.h>
#include <iostream.h>
#include <conio.h>
using namespace std;
main ()
{
  char input1[40];
  char input2[40];
  cin>>input1;a
    cout<<"\n";
    cout<<strlen(input1);
    getch ();          
  return 0;
}


1
2
3
4
5
6
7
8
9
10
int main ()
{
  char input1[40];
  char input2[40];
  gets(input1);
    cout << input1 << "\n";
    cout<<strlen(input1);
    getch ();          
  return 0;
}
what is the used of gets in this program???
thanks for the help. :))
It does not matter....
Topic archived. No new replies allowed.