Okay, so immediately after posting this, I think I may have found the source of the issue. strcat() in the while loop is causing the memory corruption. Commenting that out, and the realloc() error...
Type: Posts; User: kbfirebreather
Okay, so immediately after posting this, I think I may have found the source of the issue. strcat() in the while loop is causing the memory corruption. Commenting that out, and the realloc() error...
After looking online for a string replace function in C and finding so many examples that go through the entire string twice. First round to find how number of occurances of substitute in string,...
Today I learned. Thank you for explaining that to me. Would have never found this out if it weren't for the system I was using!
Thanks for taking the time looking into this. Very strange. I'll just leave it as is at the moment as this should hopefully not be a problem for me as long as I don't do weird offsets like the...
Yeah, it works beautifully on x86 machines, but the ARM is definitely doing something strange.
Size of int, and int* both return the value of 4.
Yes, i would normally do as you suggested, main_pointer + sizeof(int *), but the point behind this little script is to leave bits 4 and 5 as dead...
Okay, so I figured out what's happening, but not sure why or how to deal with it.
I modified the code a little bit:
#include <stdio.h>
#include <stdlib.h>
int main(void){
//10 byte bank
You are right, my comment is incorrect, but the idea is still the same. I had co-workers run it as well and get the correct results. I think it's the architecture of my server, looking into it now.
#include <stdio.h>
#include <stdlib.h>
int main(void){
//10 bit memory bank
char *main_pointer = malloc(10);
// array of 2 integers (8 bits)
int **int_pointer_array =...
Thank you! I can't believe I spend 12 - 3 last night and didn't figure this out. Rusty Rusty C. Thanks again.
The code is located at: C code - 79 lines - codepad
The problem I'm having is in askUserForAmount();
http://i.imgur.com/Ic4XcXJ.png is my output.
I use "Title here" for title.
I use...
I'm getting multiple errors with attempting to use that method. Should the fgets function be in the format of
char buf[100];
int BUFSIZ = 100;
fgets(buf, BUFSIZ, fp);
and should the sscanf...
I'm trying to find a way to input data from a file, line by line, into two separate arrays.
Say I have a file, input.txt:
3 hp psc 2210
0 inkjet
100 laserjet
I need to first, get the number,...
If an INITSIZE isn't required for my case, I can go ahead and findNewSize(); and use that value to malloc the array. Is this correct?
Thank you very much, I'm gonna go ahead and mess around with this.
so I would have....
#include <stdio.h>
#include <string.h>
int *intArray[];
char *charArray[];
I've been trying to find the solution to this, but have been consistently coming up empty handed.
Say I have 2 global arrays, one of char and one of int
#include <stdio.h>
#include...
Well the receiving side reads the message which should have the type in the rcvbuf struct that's passed through the function. which is where you have to detect for the last message which is one thing...
Hey, I actually made another thread, if you have any input, please reply :)
http://cboard.cprogramming.com/showthread.php?p=831753#post831753
well I believe I am using MTYPE and MEND correct? In send file, when we get to eof that means that the last message is being sent, so when c==1 (eof), i set the .type to MEND, then in rcv file I have...
Well I think my problem is in rcv_file, but I feel like I'm not handling it correctly. When I run the program it always tells me that "rcv_file failed" which is because rcv_file is returning -1, but...
When you execute the program, in my case I would do..
cse473-ipc inputfile outputfile
the input file gets sent to send_file, and the output file gets sent to rcv_file
is that what you...
thanks, I think I have it from here
Okay, so I've been looking at your suggestions and I'll just go down the list.
The first one is what you said in create_ipc function. I was thinking the same thing you were, but it looks like my...
Thank you for the input, a lot of that makes sense. The comments with closing stdin and stdout are incorrect, because my roomate showed me I was closing the wrong ones in the wrong functions but...