473,396 Members | 1,940 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,396 software developers and data experts.

2 Simple questions

1. How do you find out the length of the following GStrings?

GString FilePath [] = {"UnSigned\\EF.DG1", "UnSigned\\EF.DG2",
"UnSigned\\EF.DG3", "UnSigned\\EF.DG4", "UnSigned\\EF.DG5"};

I know the length is 5 but I like to find out dynamically. For example,
I want to use that GString in a for loop.

for (int i =0; i<(I want to put the length of the file Path here); i++){

}
2. How can you search a directory to see how many files with what kind
of extensions are in that directory?

For example, I have the following directory c:\myapp; I don't know how
many files are there or with what extensions.

Thanks in advance
Jul 22 '05 #1
2 1379
nooria posted:
1. How do you find out the length of the following GStrings?

GString FilePath [] = {"UnSigned\\EF.DG1", "UnSigned\\EF.DG2",
"UnSigned\\EF.DG3", "UnSigned\\EF.DG4", "UnSigned\\EF.DG5"};
I know the length is 5 but I like to find out dynamically. For example,
I want to use that GString in a for loop.

for (int i =0; i<(I want to put the length of the file Path here); i++){

}
2. How can you search a directory to see how many files with what kind
of extensions are in that directory?

For example, I have the following directory c:\myapp; I don't know how
many files are there or with what extensions.


This is platfrom specific. If you're running Windows, then use the
functions:

FindFirstFileEx
FindNextFileEx
FindClose
-JKop
Jul 22 '05 #2

"nooria" <no****@saic.com> wrote in message news:40******@cpns1.saic.com...
1. How do you find out the length of the following GStrings?

GString FilePath [] = {"UnSigned\\EF.DG1", "UnSigned\\EF.DG2",
"UnSigned\\EF.DG3", "UnSigned\\EF.DG4", "UnSigned\\EF.DG5"};

I know the length is 5 but I like to find out dynamically. For example,
I want to use that GString in a for loop.

for (int i =0; i<(I want to put the length of the file Path here); i++){

}


You can find out the size of any array like this

sizeof FilePath/sizeof FilePath[0]

john
Jul 22 '05 #3

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

Similar topics

1
by: yiyun | last post by:
Hi, I am new to mysql and I want to ask a simple questions. I would like to initialize my InnoDB table space and I configure like below: ...
18
by: Geoff Cox | last post by:
Hello, I am trying to print out the array values for a second time but get error on page message? Thanks Geoff <html>
1
by: Proteus | last post by:
Any help appreciated on a small perl project I need to write for educator/teaching purposes. I have not programmed perl for some time, need to get up to speed, maybe some kind souls hrere will help...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
1
by: E.T. Grey | last post by:
I have been busting my nut over this for pretty much most of the day and it is driving me nuts. I posted this to an mySQL ng yesterday and I have not had any response (I'm pulling my hair out...
7
by: javedna | last post by:
Hi guys Ive got a simple problem, im designing an online questionnaire and on submission the coding that I have used to validate whether a user has filled in all the questions is supposed to...
1
by: chelisek | last post by:
I have two simple questions: I am trying to create a document using an excel spreadsheet format. I am trying to create a column that will contain numbers, just plain numbers as in account numbers...
1
by: Itanium | last post by:
Hi all! I'm new to .NET Platform and got some simple questions about efficiency... To put you in situation, to say that I'm involved in the writing of a complex regex based lexer for use over...
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
4
by: maheshgupta0248 | last post by:
Hi all, Im a newbie in php, started learning php on my own. I want to create small website using php, that contains links for two simple webpages > C questions > C++ questions C questions...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.