15,551 Topics
| |
Hi all: Just want to confirm the process that I employed to use this "critical section" feature of Microsoft Visual Studio is correct. Say, there are two processes that I want to protect. Codes: while(1st process is active) { InitializeCriticalSection(&cs); EnterCriticalSection(&cs); Do something; LeaveCriticalSection(&cs); [B]DeleteCriticalSection(&cs);[/B] } while (2nd process is … | |
I've never seen this before and am perplexed beyond belief... by the way I'm using Visual Studio I have a rather large program/game i'm working on right now, and it reads in via ifstream file i/o from binary files in several locations to initialize variables. For some reason for one … | |
THe foll is a part of a prg i have to append one dummy list to a original list at destination in the original list .So plz help me i am a new user so sorry for any mistalke Here is the code :[code] #include<stdio.h> #include<conio.h> struct node { struct … | |
Hi all: Say, my program is about to receive a string "ABC", and I want to test if the string really contains "ABC". What is the best way to test it? I am thinking of read all the characters from the incoming string one by one, but not sure which … | |
Hello there, Okay well i have tried to do this program but i'm just not sure if i'm going in the right direction. Well i have to create a text file (Did that) which is inputed into the program, and the program has to count the instances of the following … | |
I need to write a function that will take a string and an int and return the string from index int onward. for ex [CODE]Line = "Enter a line: "; WriteString(RetStr(Line,4 )); //Should return er a line: AnsiString RetStr(AnsiString Str, int Start) { int ill; ill=1; char temp; while (Start!=Length(Str)) … | |
hello, i have a few questions pls help me out with them coz am really confused .. 1. can lists or vectors passed as parameters in a function? 2. can the lists or vectors be returned ? i want to use lists or vectors in classes i need to knw … | |
Hi all: According to the library, recv() will return a zero if the socket is closed, and a SOCKET_ERROR if the socket meets an error. But when I closed my socket (at least I think I closed it properly), recv() returned a SOCKET_ERROR other than zero. Wondering why? Thank you … | |
Hi all: I have successfully opened a socket to a server and trying to send some data vai the send() function. But what surprised me is: [URL="http://www.daniweb.com/techtalkforums/wsagetlasterror_2.htm"][B]WSAGetLastError[/B][/URL]() returns nothing, which means the data has been sent to the server, however all the data (a string) will only be displayed at … | |
Hi,all.I want to know why this program can not run faultlessly? Thanks to all. [code] #include <stdio.h> #include <stdlib.h> typedef struct link{ char data; struct link * next; struct link * pre; }list; main() { list * head=NULL; /* Define the head node */ list * linklist; /* Define the … | |
Hi all: I wrote a simple program to open a socket to localhost port 8201. Codes: ...... [CODE]if (WSAStartup(VERSION, &wsadata) != NO_ERROR) { WSACleanup(); return EXIT_FAILURE; } open_socket(serverName, port); SOCKET open_socket (const char *serverName, const int port) { struct hostent *server = NULL; SOCKADDR_IN serverAddress; sock = socket(AF_INET, SOCK_STREAM, 0); … | |
Hey guys just wondering how i can sort the linked list by categoryName for the drink type list. Iv done the linked list in my code but its not sorted? Could someone help me write an algorithm or sum pseudocode [code] #ifndef GJC_H #define GJC_H /* System-wide header files. */ … | |
hi, can someone understand how the new element is being attached to the list in this code? [CODE] void insertSortedList (Node **head, int value) { /* creating a new node */ Node *ptr = createNode (value); Node **pCurrent = head; /* adding the new node to the correct place in … | |
i need to somehow detect text block (i dont need OCR just area where text is, but i am dealing with pixels) within book page and then cut everything else out. i am dealing with scanned books so i have specs and smudges in the page. the easiest way to … | |
i want to know about a program to find out the number on the cd which is presently inserted in the drive | |
I'm supposed to take user input in the form of a prefix expression, convert it to infix and postfix, and then print the results. So far, I've got both working, but I would like to add some parenthesis to the infix expression once its converted. At the moment, I can't … | |
hi, any suggestions on a good reading material or examples about linked list, doubly linked list on the web. or any good book that touches on this`topic very well..thanks bros. I want to keep one for future ;) reference. | |
Helloe all I have this small program using switch statment. the problem that when I complie this C code using gcc under Linux I get message: switch guantity not integer!! Now, when I use switch(*hello) instead switch(hello), I got run time error: segmentation fault!! I want to know where is … | |
hi everyone i have a server using windows sockets and runs on multiple computers on lan, and i need to display a list of the servers from a client machine, what is the easy way ,how can i implement it | |
I have just recently downloaded graphics code to help soup up and visualize fractal concepts which I'm developing. I plan on using a DOS desktop application which I think I can do through visual cpp from a Windows 98 S.E platform. My questions are; Where do I install the header … | |
Hi guys: I have a very strange problem here. Under Linux Mandriva Powerpack 2006, KDE I "make" the program I wrote successfully in the terminal, without any errors. And I could see there was an executable file generated in the same folder. But when I typed in the program name, … | |
Hi all: Try to do some programming under Linux. The programme I am writing is supposed to read all the char from a file via "command in line argument (i.e. agv[i])" and via redirection (i.e. read <FILE_NAME. In my program, I have written: FILE *stream; stream = fopen(argv[i],"r"); if (stream==NULL) … | |
Hello all: I successfully use `(int)i=fgetc(stream)` to read data from a file. But the problem is: All the data in the file are integers, like 3 0 2 3 0 0 1. (with a space between every two integers) Code: for(i=0;(i<100)&&((n=fgetc(stream))!=EOF)&&(ch!='\n');i++) { buffer[i] = n; printf("%d=%d ",i, buffer[i]); /*For debugging … | |
Hi.. Could any one tell me about... 1) What is top-down approach(POP) and bottom-up approach(OOP) and the difference between them.. 2) Different types of containership (might be with exs..) Thanks for the help | |
Hi Everybody! First of all i would like tell my sincere thanks to founder of this site and people sharing the information. I am Newbie to this forum & to C language too.. Now i want to start to learn C. Could any body suggest/send me some quick start & … | |
A newbie here. I try to: Using MS Visual Studio 2005; Programming some simple C programs; Want to open a text file and read whatever it the file into a member of a struct. First of all, which type is this "FILE" anyway? Secondly, does the definition of "stdin" include … | |
How to Sort a MultiDimensional Array in C ???? in ascending order ? | |
OK.......right now i'm learning about binary tree traversal and this problem looks like a total killer to me. Here's it is: Write a program that takes as input the preorder and inorder traversals of a binary tree, and produces as output the level-order traversal of the tree. All i gotta … | |
Hello! I just want to understand DDK unidrv example. As far as I've read unidrv can include two plug-ins. So,I try OEMDEV structure to send some data from one to another. But when I add some more fields in OEMDEV stucture (I mean besides OEM_DMEXTRAHEADER and dwDriverData, which are happened … | |
write a document that would outline dev-c step by step how to create a win32 dialog based application |
The End.