LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-10-2013, 12:13 PM   #1
prakashmec2008
LQ Newbie
 
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
How to check my c program with sample inputs in different folders


I wrote c program which reads input from a file, I tested the program with some sample inputs and moved those sample input files to a folder , now again I modified the program and tested with diffrrent sample inputs , each time after testing my program I put sample inputs in different folders in different names ,now I want to test my program with all the sample inputs in each directory. Is any way using makefile or alternative....thanks in advance
 
Old 05-10-2013, 02:01 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
From the sound of it, you've hard coded the input file name in your program, and you want the compiler to dynamically modify this file name when you build the code for different input files? Why don't you just make the file name a command line argument to your program so you can pass it in?
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] C Program take multiple inputs same line thehollow89 Programming 1 08-14-2010 02:48 PM
shell script for a partial control over inputs to an external program njain Linux - Software 1 05-19-2010 07:57 PM
need a ioctl sample program supernaturalyasir Programming 1 09-09-2009 08:12 AM
regarding a lex sample program... sam_cit Linux - Software 2 05-09-2006 12:16 AM
How to pass data to a console program with multiple inputs? juanbobo Programming 3 08-18-2005 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration