How to write a char array “char *buff[]” to a FILE in c?

If they're strings, you can just use something like: FILE *fout = fopen ("output. Txt", "w"); if (fout! = NULL) { char *sep = ""; for (int I = 0; I In any case, the logic is the same, the only thing that will change is the way in which you output the MAC address And if the array isn't full, then make sure you use a count variable to control the loop rather than the array size.

If they're strings, you can just use something like: FILE *fout = fopen ("output. Txt", "w"); if (fout! = NULL) { char *sep = ""; for (int I = 0; I In any case, the logic is the same, the only thing that will change is the way in which you output the MAC address.

And if the array isn't full, then make sure you use a count variable to control the loop rather than the array size.

You are assuming that "buff" is statically allocated, ie buff is char* buff10. If "buff" instead happens to be the parameter of a function, ie void func (char* buff); then your code won't work. This isn't made clear by the original post.

Also, you are writing a C++ declaration of "i" inside the loop. – Lundin Jan 27 at 15:20 Yes, I made assumptions, it was necessary due to the lack of full details in the question - that's exactly why I said "use something like ". But you should be aware that the int inside for loop is not just a C++ feature, C99 has it also.

– paxdiablo Jan 27 at 22:03.

If they're not strings, you should probably specify the data in greater detail. In any case, the logic is the same, the only thing that will change is the way in which you output the MAC address. And if the array isn't full, then make sure you use a count variable to control the loop rather than the array size.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions