473,395 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1647
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

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

Similar topics

7
by: G-Factor | last post by:
Hi all I've just started learning about saving files. I got bit of a problem. The following code gives me an error about incompatible types. (Cannot covert from class character to char *). I...
11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
1
by: Sagaert Johan | last post by:
Hi I am construncting a string containing some control chars (STX/ETX) I noticed that adding a byte with value 2 is the same as adding a character '2' ??? How can i solve this problem ?...
3
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
2
by: Bruce Russell | last post by:
This may sound stupid but I can't rename the WebForm1.aspx in the solution explorer. The file is located in my local web server at C:\Inetpub\wwwroot\Lab3-VB-Starter\WebForm1.aspx Is there...
12
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: ...
8
by: Vijay | last post by:
Hi , I am doing a small project in c. I have a Hexadecimal file and want to convert into ascii value. (i.e., Hexadecimal to Ascii conversion from a file). Could anyone help me? Thanks in...
12
by: mantrid | last post by:
Im trying to move a file but am having luck my code is below. The temp and target paths are valid as they echo correctly. but I cant get the copy() function to work, or the rename() function ...
3
saranjegan
by: saranjegan | last post by:
hi, this is the task.... rename every file in a directory by adding ascii value of 23 to each of them this is my work on this : this code is running without an error but its not getting...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.