I only skimmed through your code, so this is purely an almost random guess.
} else if (strcmp(cmd_argv[0], "add_xct") == 0 && cmd_argc == 3) { if ((g = find_group(group_list,...
Type: Posts; User: failure67
I only skimmed through your code, so this is purely an almost random guess.
} else if (strcmp(cmd_argv[0], "add_xct") == 0 && cmd_argc == 3) { if ((g = find_group(group_list,...
int arr [20] ;
rand () and srand ()
My bad, I skipped the fact you're using MSVS. MSVS is a c++ compiler, and the c++ language requires the casts that you added to your code. Pure C does not require (or recommend) those casts.
...
When people say they are implementing a function, they usually mean that they are writing that function. It doesn't look like you are creating your own custom malloc, calloc, and free functions. I am...
binNum will never become NULL if malloc succeeded, so the while loop in your main function will run forever (or until SegFault, whichever comes first). You're also printing the binary backwards....
In your example, according to your output, only three additions actually took place. Do you want:
A) 5 additions to take place or
B) Do you want to stop once your reach the 5th element of your...
I haven't really posted in any of your threads because I honestly don't understand anything about your program, but I've been following this over the weeks. So just because very few people are...
Look at my updated post. You should use a function like pow for what you're trying to accomplish.
Just skimming your code, so I could be totally wrong, but I imagine you're not meaning to use the XOR operation in line 24.
Just in case you don't know what I mean:
temp =...
I'm guessing RETI stands for "return from Interrupt". This is a really vague question because it depends on the type of architecture you're learning about. For instance, my school used a simplified...
A String is just an array of characters. You can either use an array like this
char ch[32];
or you can allocate memory to a pointer and treat it as an array.
So like Tater implied, what you...
Just in case you come back for help, here's an additional hint. Take Salem's code and add one print statement to it; that's all you need to do. Also, look up the left shift operation.
Bitwise...
Lookup atoi or strtol for converting the command line strings into numbers.
Lookup fopen for opening a file.
Lookup fprintf for writing to a file.
Feel free to post your code if you want more in...
Checkout ctype.h. It might make a few things easier for you.
My final sentence qualifies that.
My confusion comes from trying to figure out where he got the 256 and 50/50 numbers from. For the 256, the only ways I could think of somebody coming up with...
Um, EOF is an int. So assuming an int is 32 bits, then wouldn't the percent chance of EOF showing up by default be (2^-32)(100)? This, of course, isn't taking into account how often programs store...
Look at line 15.
while(juga!=1)
juga is a function, not a variable.
Edit: Someone beat me to it! :)
When j == 0, you are NULLing the pointer. j ends up being zero in two cases:
1) On blank lines
2) At the end of the file
2 is true because of the order in which you do everything.
No,...
Here's a few links I found on this subject. (They're for Windows though)
Writing directly to video memory? [Archive] - CodeGuru Forums
OSDev.org • View topic - Writing to video memory, is...
Here are two problems I found with your function. Use this as your input text:
So line one is blank and line two contains the character 'a'. There is no line 3. Here's what your code would do:...
I ran your getlist function and it seems to work correctly. Could you show us where you free up everything? There might be an error there.
If realloc fails, you are guaranteed a memory leak since you're not using a temporary variable. That's probably why you're getting an out of memory error.
I won't do your homework for you, but I wrote a program that does similar things to what your program needs to do. Read the comments and try to understand the code. Then modify it to your needs.
...
You should probably create a second topic for this other program.
Look at this piece of code by itself.
char is_valid(char valid_y_n) {
valid_y_n = tolower(valid_y_n); ...