Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
~2K People Reached
Favorite Forums
Favorite Tags
Member Avatar for halluc1nati0n

Aight. I have a query regarding File I/O : [CODE]// Keep reading the file in a loop for some 100 seconds.. for (int x=0; x<100; x++) { // Code for reading file - say readFile() Thread.currentThread().sleep(1000); /* sleep for one second */ }[/CODE] Now, I need to read a file …

Member Avatar for halluc1nati0n
0
578
Member Avatar for halluc1nati0n

I was trying out a 2-dimensional integer array on a UNIX box. I hit up a 'Segmentation Fault' on trying to run it. [CODE]#include <iostream> #include <cstdlib> using namespace std; int main() { int matrix[2000][2000]; int i, j; srand ( 1 ); for (i=0; i<2000; i++) { for (j=0; j<2000; …

Member Avatar for halluc1nati0n
0
204
Member Avatar for halluc1nati0n

Tried this on my UNIX box.. Why aren't the array contents being stored/displayed ?? [CODE]#include <iostream> #include <fstream> #include <unistd.h> #include <sys/signal.h> using namespace std; int main(int argc, char *argv[]) { int pid; pid_t pid_chk; int pid_array[2]; int count[25], length, i, j; for (i=0; i<3; i++) { pid_array[i] = 0; …

Member Avatar for vmanes
0
149
Member Avatar for halluc1nati0n

[CODE]#include <stdio.h> #include <fcntl.h> #include <iostream> using namespace std; int main() { int fd, i, oflag; char buf[100]; oflag = (O_RDONLY); fd = open("from4to5", oflag, 0x1c0); if (fd < 0 ) {printf("Error opening\n"); exit(1);} while ( (i = read(fd, buf, 16)) != 0 ) { cout << "child: # bytes …

Member Avatar for halluc1nati0n
1
296
Member Avatar for halluc1nati0n

I have trouble understanding the compilers. The following code does work in UNIX under g++, but under VC++ it would not even compile. Anyone can provide valid reasons why? [B]Code:[/B] [CODE]#include <stdio.h> #include <iostream> #include <string.h> using namespace std; int main() { string tmp_nw_msg, crc_chksum, buffer; cout << "Enter the …

Member Avatar for Nick Evan
0
214
Member Avatar for halluc1nati0n

I'm trying this in Visual Studio 2005 (VC++) [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> #include <bitset> #include <sstream> #include <conio.h> #include <iostream> using namespace std; #include <time.h> string tot_msg, message, to_be_sent_msg, sent_msg, msg_to_be_sent; char * transport_layer_data_header; char * transport_layer_data_msg; bool whole_msg_sent=false; int actual_len, i, seq_num=0; char * mynode = "2"; …

Member Avatar for mrnutty
0
247
Member Avatar for halluc1nati0n

'Learning CPP' programmer here. So, bear with me. First off : [B]STRCAT : [/B] [url]http://www.cplusplus.com/reference/clibrary/cstring/strcat/[/url] When clearly the definition says : [CODE]char * strcat ( char * destination, const char * source );[/CODE] Why'd they use char str[80] in the example??? What types can be used?

Member Avatar for Dave Sinkula
0
105