From: James W Sager Iii Newsgroups: comp.os.msdos.djgpp Subject: Attempting to make an auto indenter Date: Sat, 17 Mar 2001 02:42:04 -0500 Organization: Carnegie Mellon, Pittsburgh, PA Lines: 54 Message-ID: NNTP-Posting-Host: po7.andrew.cmu.edu X-Trace: bb3.andrew.cmu.edu 984815178 3700 128.2.10.107 (17 Mar 2001 07:46:18 GMT) X-Complaints-To: advisor AT andrew DOT cmu DOT edu NNTP-Posting-Date: 17 Mar 2001 07:46:18 GMT X-Added: With Flames (outnews v2.6) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Since I do not have the time to space out my code as I go along, I was hoping to save time by making a program that takes as its argument a C/C++ file and indents it automatically depending on {}. I'd really like to see this feature in rhide, but since it does not exist, I need to code it up. My code however is buggy because I suck really badly at interfacing with other people's code... I can't even get my program to read in a line without getting extra Ascii gibberish. Anyone have the code to read in a line of text out of an Ascii text file? My code looks like this: #include #include FILE *in; char *getline(FILE *f1); void main(void) { //using cut and pastest code I had from a genetics project... //This is why I'm using enz(enzyme) for text holders char enz[250]; char enz2[250]; in = fopen("test.txt", "rt"); while (!feof(in)) { strcpy(enz,getline(in)); cout<