- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
10 Posted Topics
Re: If you really want to make an array of char without '\0' at the end of it. You could make something like this [CODE] #include<stdio.h> int main() { char *insert = "abcdefgh"; char outsert[8]; //I use 8 because abcdefgh contains 8 char int i; for (i=0;i<8;i++) { outsert[i] = insert[i]; … | |
Re: You could use rand() or srand() for it. Read the manual in google for the details. | |
I've got an assignment about database recovery system. I need to find an organization/enterprise and figure out its recovery system. I ask for help from someone who ever made or knew database recovery system applied by an organization/enterprise. Please share me some details. Thank you. Best regards, | |
Re: Your array can't contain all the number. You'll save 2*numsegs to your array[numsegs]. fgetc returns char type but your array is int type. Maybe that's the problem | |
Re: I suppose you've made some mistake at while loop from line 39 to 50. Value of b can't fulfill the condition to end. This line made it b = b%16; | |
Re: You've done some mistake at line 14, 22, and 30. Actually, when you declare char TempString[60]; it means you've allocated 60 char with index from 0 to 59. Hence you can't access TempString[60]. May my advice useful. | |
Re: 1. Do these code valid? [CODE]port=atoi(argv[2]);[/CODE] I suppose atoi() isn't ANSI C You could use this for exchange [CODE]sprintf(argv[2], "%d", port)[/CODE] 2. This syntax is risky [CODE]numberOfBytes=recv(activeSocket, buffer,MAX_SIZE, 0);[/CODE] It will be safer if you use these one [CODE]numberOfBytes=recv(activeSocket, buffer,MAX_SIZE-1, 0);[/CODE] Forgive me whether none of of my answer help … | |
Re: You could declare some global variable so you could exchange handle in it but you must do it carefully. IMHO I think you don't need to make a thread for a line-counting program. | |
Greetings Let me introduce myself Name is Reza Auliandra Students from Indonesia Thank you. Nice to meet you guys... | |
Re: 'A' is a char. "A" is a string. String is an array of char that ends with NULL. |
The End.