|
Does knowing the format of an ISO file help?
http://www.wotsit.org/download.asp?f=iso9660
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The format of an ISO is iso9660
Thanks
Thank You
Regards,
ntuyen01
|
|
|
|
|
Right. Did I indicate otherwise?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Would you please tell me what do you mean?
Thank You
Regards,
ntuyen01
|
|
|
|
|
You wanted to know how to extract the contents of an ISO file. I simply provided you with a link to the ISO file format. Usually when one knows the format of a file, they can start to put code together that will operate on said file.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Why that difficult? Code an easy CD emulator (that is a thing of lets say 2 hours) and use the windows file system driver (cdfs) for mounting the image and reading it via the normal file management API.
Don't try it, just do it!
|
|
|
|
|
If that'll work, great! I've never dealt with CD-type files so I was just taking a SWAG.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
well you can look at linux and *BSD source code to see how they read it from CDs. C, but might be useful. I don't know if it is easier to start from scratch or not, but you might try write a wrapper for their code.
http://www.freebsd.org/
|
|
|
|
|
What do I need to look at the http://www.freebsd.org/?
Thank You
Regards,
ntuyen01
|
|
|
|
|
|
I'm writing a program which needs to get the mouse capture in order to be able to select a part of the screen. I've tried this using GetCapture, but that doesn't work, because at the moment I start dragging at a point that is not in the my app's window, the capture is lost and the window at that point is activated.
Is there some way to prevent this loss of capture AND focus?
|
|
|
|
|
I'm trying to set up a function which sorts the 10 elements of my array utilizing pointers. It's just a learning exercise for my C++ class. Can anyone explain why the following code only makes 1 iteration and how I can get it to keep moving?
void sort(int iArr[], int size)
{
int *iPtr = iArr;
for (int i = size-1;i>0;--i)
for (int j=0; j<i; ++j)
="" if="" (*iptr=""> *iPtr+1);
{
int temp = *(iPtr);
*(iPtr) = *(iPtr+1);
*(iPtr + 1) = temp;
}
}
|
|
|
|
|
Anonymous wrote:
for (int j=0; j if (*iPtr > *iPtr+1);
do you mean:
for (int j=0; j if (*iPtr > *(iPtr+1));
?
also, don't you need to move the pointer somewhere? looks like iPtr is always pointing at the first element of the array.
Software | Cleek
|
|
|
|
|
It seems as though no matter where I put the code to increment iPtr, I still only get one iteration. Seems like this should be so simple, but no matter what I do I can't get it to work. The assignment was to take a previous assignment and write it so that the print & sort funtions are handled with pointers instead of arrays. Can you give me advice as to where in the code that I wrote I would insert the increment? Yes, I'm a newbee. I took structural C 4 years ago and I'm afraid I've lost a lot in 4 years.
|
|
|
|
|
it's kindof hard to tell what's going on with your code, since the board reformatted it a bit.
try reposting it inside <pre>...</pre> tags, and put spaces after any < signs (like in your for loops and in the if(...). that should keep the board from doing too much damage.
Software | Cleek
|
|
|
|
|
Thanks for your help. At this point my class is in 3 hours, so I'm going to just get the teacher to help me out. I think part of the problem is that I'm basing this portion of code on the original program which didn't utilize pointers, and I'm getting very confused. Your time is much appreciated. This is a great board. Take Care,
Dawn
|
|
|
|
|
Anonymous wrote:
Can anyone explain why the following code only makes 1 iteration...
What is the value of size ? If it is 2, then the outer loop would only execute one time.
There are other reasons why this routine will not produce the desired result but we'll get to those once the loop issue is resolved.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
When I wrote this little program below, I didn't even define the value of size, and it executes with the desired results. I get one print out of the array, and the second time the print function executes the list is sorted. When I try to employ this same logic using pointers, the sort loop only makes one iteration:
#include <iostream>
using namespace std;
void Print (int [], int);
void Sort (int [], int);
void main()
{
const int max =10;
int list [max] = {7, 4, 9, 1, 8,
3, 6, 5, 0, 2};
Print (list,max);
Sort (list, max);
Print (list, max);
}
void Print (int array [], int size)
{
for (int i=0; i<size; i++)
cout="" <<="" array="" [i]="" "="" ";
cout="" endl;
}
void="" sort="" (int="" [],="" int="" size)
{
for="" i="size-1;i">0;--i)
for (int j=0; j<i; ++j)
if="" (array="" [j]=""> array [j+1])
{
int temp = array[j];
array[j] = array[j+1];
array[j+1] = temp;
}
}
This programs works beautifully.
|
|
|
|
|
Dawners wrote:
I didn't even define the value of size...
Actually you did. It had a value of 10.
When switching from array[] to pointers, keep in mind that array[j] is equivalent to *(array + j) .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
How are you coming along with this?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
LOL
If you look really close then you would see why the loop is making all the iterations you want, but your code gets only executed once... If you used the debugger, you would've solved the problem in no-time.
I don't understand why the other people on this board have been so sloppy not to see the ; behind the 2nd for loop!!!!! Remove that and you'll have no problem...
Next time, use the debugger first.
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Good eye;
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Bob Stanneveld wrote:
I don't understand why the other people on this board have been so sloppy not to see the ; behind the 2nd for loop!!!!!
This is a forum display error!!! If you look closely it is a combination of 2 lines the lines should show
for (int j=0; j<i; ++j)<br />
if (*iPtr > *iPtr+1);
You need to look at the HTML source to find this out!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Oops, this is the point where I should hit myself and be ashamed of accusing people of not seeing an error that I out of a few did not see...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
void sort(int iArr[], int size)
{
for (int i = size-1;i>0;--i)
{
int *iPtr = iArr;
for (int j=0; j < (size - 1) ; j++)
{
if ( *iPtr > *(iPtr+1) )
{
int temp = *iPtr;
*(iPtr) = *(iPtr+1);
*(iPtr + 1) = temp;
}
iPtr++;
}
}
You have forgot to increment the pointer in the inner for loop and reset the same in outer for loop
Sandeep Naik
|
|
|
|