This is definitely more of a question than an answer, but could the OP create a new thread and then call something like (sleep) within that thread?
Type: Posts; User: steez
This is definitely more of a question than an answer, but could the OP create a new thread and then call something like (sleep) within that thread?
Ah I see.
Then in this case, sizeof(struct whatever) probably doesn't take into consideration the types of data in the struct but rather how many elements there are?
struct student {
char id;
char *name;
int grade;
};
int main ()
{
struct student school[2];
Thank you for the clarification.
Still, in what types of errors should I return EXIT_FAILURE? See the above post.
What am I missing here? I don't see why you can't just exactly copy all of the file byte for byte.
What about returning zero and nonzero within int main(), for instance? Is it pretty much at your discretion for which errors would correspond with returning nonzero?
Example:
int main ( int...
Ok, I see. Thank you!
This still requires more and more indentation for every time you check for a new, different error as the function continues; you don't think much of it?
Which code is appropriate/for what situations should each of these methods of handling an error be used?
if (error)
{
printf("error message here");
}
else
{
// continue as normal
Yes, I made a mistake, I thought the %p took care of that for me (I thought I was supposed to pass the pointer's address to it for some reason, which makes no sense in retrospect).
I edited my above...
Edit: nevermind. I couldn't get the %x version to work the same as the %p version, but now I have:
#include <stdio.h>
int main ()
{
int myArray[] = {5, 6, 7, 8};
int * myPointer =...
What's the best way to do this? Pretty much any way I try it, I get what I expected -- the compiler automatically takes into account the size of the variable. However, now I'm curious. Here's my...
Example:
int myArray[] = {5, 6, 7, 8};
int *myPointer = &myArray[0]
Why is the following true?
*(myPointer+1) == 6
I get the concept, but shouldn't this only hold true if the variable is...
I'm not printing it to view as output, rather I'm writing to a file to encrypt the file (e.g. a .txt file or a .jpg). For this reason it makes much more sense that I should have just used fwrite() to...
Ah, ok. I don't know why I didn't think to do this... I had been using fread() and such and yet for some reason used fputs() instead of just fwrite().
Thank you very much!
I'm dealing with two strings, one being the string that I want to encrypt using XOR encryption and one being my "key" that I XOR the original string against.
for (a simplified) example:
while (...