how to convert an char array to decimal array

Answer Posted / yogesh

#include<stdio.h>
int main()
{
char str[40],*s;
char ch,ask;
do
{
s=str;
printf("Enter the string:");
fgets(str,40,stdin);
do
{
printf("%d ",*s++);
}while(*s);
printf("\nDo u want to enter another string
(y/n):");
ask=getchar();
if(ask=='n')
break;
}while((ch=getchar())!='n');
printf("\n");
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I sort a linked list?

631


Explain what are linked list?

615


How many bytes are occupied by near, far and huge pointers (dos)?

664


What is a nested loop?

643


How can I do serial ("comm") port I/O?

681






Why is sprintf unsafe?

613


When can a far pointer be used?

584


What is the maximum length of an identifier?

661


What is the use of structure padding in c?

560


What is the g value paradox?

641


How does struct work in c?

604


Are pointers integers in c?

605


How can I get the current date or time of day in a c program?

647


difference between Low, Middle, High Level languages in c ?

1628


What is the difference between array and pointer?

560