468,761 Members | 1,751 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,761 developers. It's quick & easy.

Rename a File by adding ASCii value of 23

saranjegan
Dudes,
this is my doubt

i need to rename a file,i can make it thru rename function..but the modified name should be an original name added with ascii value of 23..
these are questions
how can i convert a string to ascii?
whether i can add 23 to the obtained value?
can i again convert it to string?
Feb 13 '07 #1
2 1427
Dudes,
this is my doubt

i need to rename a file,i can make it thru rename function..but the modified name should be an original name added with ascii value of 23..
these are questions
how can i convert a string to ascii?
whether i can add 23 to the obtained value?
can i again convert it to string?

Sample code is :

#include <stdio.h>
#include <conio.h>
int main()
{
char *a;
int i,len;
clrscr();
a="Hello";
printf("The Content of the string is : %s\n",a);
len=strlen(a);
for(i=0;i<=len;i++)
{
a[i]=(a[i]+23);
}
printf("The Content of the string is : %c %d\n",a[0],len);
getch();
return 0;
}
Feb 13 '07 #2
Sample code is :

#include <stdio.h>
#include <conio.h>
int main()
{
char *a;
int i,len;
clrscr();
a="Hello";
printf("The Content of the string is : %s\n",a);
len=strlen(a);
for(i=0;i<=len;i++)
{
a[i]=(a[i]+23);
}
printf("The Content of the string is : %c %d\n",a[0],len);
getch();
return 0;
}

Dude, thnks for ur reply..i will make it..
Feb 13 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by G-Factor | last post: by
11 posts views Thread by Abhishek | last post: by
3 posts views Thread by Saradhi | last post: by
2 posts views Thread by Bruce Russell | last post: by
12 posts views Thread by Adam J. Schaff | last post: by
8 posts views Thread by Vijay | last post: by
12 posts views Thread by mantrid | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.