473,668 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rename a File by adding ASCii value of 23

saranjegan
51 New Member
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 1654
rajesh6695
96 New Member
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
saranjegan
51 New Member
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
7524
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 would appreciate it if anyone could either help me out, or direct me to an online resource site that has information on saving/loading classes. I have found several tutorials, but they either do not really help (saving text files) or are too...
11
6621
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 transfer data across.On the serve I am using Socket 2 API (recv function to read bytes)and not using ..NET. I use FileStream to open the file on the pocket pc, then associate a BinaryReader object with the stream and call ReadBytes to read all the...
1
6180
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 ? Is the stringbuilder restricted to pure readable ascii code contents ?
3
6057
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 hierarchical view of Parent Nodes and projects where in a projectnode can be added to any ParentNode and hence we may have a project node added to 100 Parent nodes. In this one, I have an operation of Renaming a Project Node. So whenever I am doing the...
2
2955
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 some configuration problem in my IIS setup? Thanks,
12
5877
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: <gibberish>file//g:\pathtofile1<gibberish>file//g:\pathtofile2<gibberish> etc. I want to remove the "g:\" from the file paths. I wrote a console app that successfully reads the file and writes a duplicate of it, but fails for some reason to do the "replacing" of the "g:\". The code...
8
18647
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 adv.
12
2891
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 $target_path = $targetdir . basename($uploadedfile); $temp_path = $tempdir. basename($uploadedfile); echo "Target - ".$target_path." Temp - ".$temp_path."<br>";
3
4981
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 renamed...i want to know whethet this logic works or some violation errors.. #include<stdio.h> #include<conio.h> #include<dirent.h> int main(void) {
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5681
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.