473,513 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help: How to reformat existing c++ files using emacs or VC6.0

If there is any command for formatting all files under a directory, that
would be best.
But currently, formatting a single file is enough for me. I just can not
type TAB at each line.
Thanks a lot!

--
Xiaopeng Xiong
CS143, Computer Sciences Building
Purdue University, West Lafayette, IN, 47907
Tel: (765)496-6038
URL: http://www.cs.purdue.edu/homes/xxiong
Jul 23 '05 #1
3 1549
Xiaopeng Xiong wrote:
If there is any command for formatting all files under a directory, that
would be best.
But currently, formatting a single file is enough for me. I just can not
type TAB at each line.


Is there a C++ _language_ question I'm not seeing? Are you asking how to
open files and replace their contents with other contents? std::fstream
class is used for file reading/writing. Replacement is rarely done in
place, you're better off creating a new file for every one you need to
edit, and then renaming the old file with .bak or something and the new
file to have the name of the old file. 'std::ifstream' is for reading
and 'std::ofstream' is for writing.

Or maybe you're asking about a tool that can change your source files for
you? Look up "C++ beautifier" on the Web. If you need to know how to do
the formatting in your text editor, why don't you just RTFM?
Jul 23 '05 #2
Xiaopeng Xiong wrote:
If there is any command for formatting all files under a directory, that
would be best.
But currently, formatting a single file is enough for me. I just can not
type TAB at each line.
Thanks a lot!


i would venture to say your post is OT. post to emacs or VC NG. but, i'll
answer anyhow. for emacs. i haven't used anything but in a long time so i
wouldn't know how to do it in VC.

i don't know about doing a whole directory at a time - although it's
certainly possible with emacs. for a single file, open the file, make sure
you're in c/cpp mode. type:

C-x-h
C-M-\

cheers,
anoop aryal.

Jul 23 '05 #3
Okay I see the question is out of the scope here. Let's finish this topic
now. Sorry.
Thanks Victor and Anoop for the detailed help. I did get some ideas out of
the replies.
"Anoop Aryal" <aa****@foresightint.com> wrote in message
news:KL*****************@newssvr17.news.prodigy.co m...
Xiaopeng Xiong wrote:
If there is any command for formatting all files under a directory, that
would be best.
But currently, formatting a single file is enough for me. I just can not
type TAB at each line.
Thanks a lot!

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2902
by: Brett Baisley | last post by:
At school, we do all of our coding in emacs, but I am trying to get the example apps working at home using Visual C++.net. In the example, there are 4 .cpp files (canvas.cpp, main.cpp,...
1
9587
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
118
6584
by: 63q2o4i02 | last post by:
Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely...
0
3067
by: Xah Lee | last post by:
Interactive Find and Replace String Patterns on Multiple Files Xah Lee, 2006-06 Suppose you need to do find and replace of a string pattern, for all files in a directory. However, you do not...
7
1769
by: rn5a | last post by:
This is the second time I am asking this question in this newsgroup since I haven't got a solution or response from anyone in my previous post & I need to resolve this issue desperately. Sorry for...
5
14413
by: Glen Buell | last post by:
Hi all, I have a major problem with my ASP.NET website and it's SQL Server 2005 Express database, and I'm wondering if anyone could help me out with it. This site is on a webhost...
11
1453
by: Roy | last post by:
Hi , could you please list the reasons why we different C files for writing code . We use header files to logically group functionality that is related . Is there any other reason why we need...
1
1206
by: sparks | last post by:
We are redoing an existing database and need to reformat all the number fields from integer to single fixed 3. their main thing is negative numbers and the decimal places. Can this be done in...
4
195
by: Mark McIntyre | last post by:
Hallvard B Furuseth wrote: Setting aside that 4 is an entirely sensible tab width... This seems to be the showstopper. Unless you now entirely own the code yourself alone, don't reformat it...
0
7157
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
7379
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,...
0
7535
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...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5682
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,...
0
4745
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...
0
3232
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...
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.