473,394 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

change subdirectory in for loop

Hi,

I need to open files in different subdirectories of my local directory. The subdirectories have the names 1,2,3 ...,N. How can I make a for loop to open the files in the different folders ? Something like

for( N ) {
fpointer=fopen (../N/filename,"r")
...
}

??
Mar 28 '07 #1
2 1619
arne
315 Expert 100+
Hi,

I need to open files in different subdirectories of my local directory. The subdirectories have the names 1,2,3 ...,N. How can I make a for loop to open the files in the different folders ? Something like

for( N ) {
fpointer=fopen (../N/filename,"r")
...
}

??
You may want to have a look at the sprintf function to assemble the file names.
Mar 28 '07 #2
Thanks ! That looks good !

You may want to have a look at the sprintf function to assemble the file names.
Mar 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bill | last post by:
Will IIS6.0 recognize a global.asa file located in a subdirectory on the webserver? I'd like a file that will execute whenever a file in the subdirectory is browsed - or, at least it is...
7
by: SOW Olivier | last post by:
hi, i have a site wich is in a subdirectory of the webSite. I have to use a global.asa file to set session.timeOut even i create an IIS application on the subDirectory global.asa don't run ?!?...
8
by: RML | last post by:
hey guys, i am looking at this piece of code that lists numbers of files in a directory. i want to convert it so it lists the files in th directory that end with .doc. i cant seem to get it to...
4
by: tomek | last post by:
hi i'm desperate... i'm trying this for 2 days now... so if anyone can help - please. i have upload form in which users can choose TYPE of file they are uploading (graphic/text/music) - and...
4
by: Just D. | last post by:
How can we change the property of one subdirectory of the Virtual Directory? One of the directories should be granted "Write". Should we delete this Virtual Directory to recreate it with the...
0
by: Just D. | last post by:
All, I created a tool to setup our web apps, it does almost everything now, but how can we change the property of one of the subdirectories? One of the subdirectories should be made Writeable. ...
2
by: keith | last post by:
I created a subdirectory in a project and added an image to the subdirectory from the project and set its property Build Action=Embedded Resource. Then instanciate a image by Image img=new...
0
by: =?Utf-8?B?Qm9ubmll?= | last post by:
I have a basic ASP / Index Server search page. I have a web site contained in a subdirectory in the root of a main web site. What I’m trying to do is force the search page in the subdirectory,...
0
by: =?Utf-8?B?bW9iaWxlbW9iaWxl?= | last post by:
Hi all. I have experience with C#/VB.NET and ASP Classic, but am very new to ASP.NET. I'm using ASP.NET 2.0 and am modifying a site. I copied the site files to a subdirectory to test and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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
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
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...
0
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...

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.