GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  Subex Systems
Go To First  |  Previous Question  |  Next Question 
 Subex Systems  |  Question 3 of 5    Print  
write a program to remove the c comments(/* */) and c++ comments(//)from a file.The file should be declared in command line.

  
Total Answers and Comments: 1 Last Update: September 03, 2006     Asked by: sisir kumar jena 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 03, 2006 02:30:02   #1  
rajajayan.j        

RE: write a program to remove the c comments(/* */) an...

#include<stdio.h>
void main()
{
FILE *FI *FO;
char ch;
FI fopen( source.c r );
FO fopen( target.txt w );
ch getc(FI);
while(ch! EOF)
{
if(ch '/')
{
ch getc(FI);
if(ch '/')
{
while(ch! 'n')
{
ch getc(FI);
}
}
if(ch '*')
{
while(ch! EOF)
{
ch getc(FI);
if(ch '*')
{
ch getc(FI);
if(ch '/')
break;
}

}
}
ch getc(FI);
}


putc(ch FO);
ch getc(FI);
}
close(FI);
close(FO);
}


 
Is this answer useful? Yes | No

 Related Questions

Write a program to remove the c comments(/* */) and c++ comments(//)from a file.The file should be declared in command line.
Read Answers (1) | Asked by : sisir kumar jena


 Sponsored Links

 
Related Articles

ERP Systems as Quality Control Support

ERP Systems as Quality Control Support For the past few years ERP systems have became one of the most powerful tools for quality control management But ERP is just an informatics system that provides support to the integrated business management mosgoogle center Goals of the Quality Control Module i
 

What is Data File

In a logical data model, the conceptual data model which is based on the business semantic is being defined. Thus, entities and relationships and corresponding table and column design, object oriented classes, and XML tags, among other things are being laid regardless of the database will be physica
 

On-Line Transaction Processing

On-Line Transaction Processing On-Line Transaction Processing is a processing that supports the daily business operations. Also know as operational processing and OLTP.&nbsp; An OLTP is a database which must typically allow the real-time processing of SQL transactions to support traditional reta
 

On-Line Analytical Processing

On-Line Analytical Processing On-Line Analytical Processing is a processing that supports the analysis of business trends and projections. It is also known as decision support processing and OLAP.&nbsp; An OLAP software enables companies to have real-time analysis of data stored in a database. A
 

Evolution of database systems

The Evolution of Database systems File Management System Hierarchical database System&nbsp; Network Database System&nbsp; Relational Database System File Management System: The file management system also called as FMS in short is one in which all data is stored on a singl
 

What is the use of truncate command?

Truncate command will delete all records and the most important thing to make note of truncate command is since truncate command cannot be rolled back one must make sure to take proper backup of table data before performing the truncate command. Truncate command is thus used to remove all rows from
 

How is the main() function declared?

The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
 

What happens when a variable is not declared in function definition?

Generally in C program the function definition and calling takes the form as given below: main() { int x,y,z; z=sample(x,y); printf(&ldquo;%d&rdquo;,z); } sample(x1,y1) int x1,y1; { int z1; z1= x1 - y1; return(z1); } Here what happens is the values x, y gets passed to x1,y1
 

How to define command line arguments

The main functions can have arguments passed which are called as command line arguments. There are two command line arguments: Argument count denoted by argc and Argument vector denoted by argv The argc is an integer variable which denotes the number of parameters passed and argv is pointer to a
 

How to develop compile and run a C program

The steps involved in building a C program are: 1. First program is created by using any text editor and the file is stored with extension as .c 2. Next the program is compiled. There are many compilers available&nbsp;like GNU C compiler called as gcc, Sun compiler, Borland compiler which is pop
 

Related Categories
Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape