Converting String To Long in C - Geeksforgeeks
Converting String To Long in C - Geeksforgeeks
Arrays in C/C++
Complete Interview
std::sort() in C++ STL
Preparation- Self
Converting Strings to
Numbers in C/C++ long int strtol(char *string, char **ptr, int base)
Substring in C++
Function Pointer in C
fork() in C
Strings in C
Data Types in C
Structures in C
Static Variables in C
Functions in C++
Output
TCP Server-Client
implementation in C
Number is 1234567890
int main()
{
char string[40] = "100 GeeksforGeeks";
long integer;
char* ptr;
return 0;
}
Output
#include <stdlib.h>
#include <stdio.h>
int main()
{
long l;
char *str;
str = "349639 geeksforgeeks";
l = atol(str);
printf("l = %.ld\n",l);
}
Output
l = 349639
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
long i = 1234;
char buffer[100];
Output
string is 1234
// Driver Code
int main()
{
// To store Number in String form.
char string[10] = "123456789";
long integer = 0;
int i = 0;
Output
Number is 123456789
Like 1
Previous Next
01 05
Converting Number to String in C++ How to write long strings in Multi-
09, Jul 16 lines C/C++?
09, May 15
02
Write your own strlen() for a long 06
string padded with '\0's Is there any need of "long" data
24, May 15 type in C and C++?
21, Sep 17
03
C Program For Long to String 07
Conversion Working of Keyword long in C
25, Jul 22 programming
13, Oct 18
04
Converting Strings to Numbers in 08
C/C++ Print a long int in C using putchar()
02, May 16 only
24, Feb 14
Article Contributed By :
pushpamkjha14
@pushpamkjha14