I was wondering if it was safe to make GL calls with multiple threads. Basically I'm using a GLUtesselator and was wondering if I could divide the objects to draw into 4 and assign a thread to each one.
I'm just wondering if this would cause trouble since the tesselator uses callback functions. Can 2 threads run the same callback at th...
Im trying to make a script that can generate a kind of chat client in cygwin on windows but i dont have a clue how to start, i saw something like gtk+ but how do i get that inside of cygwin, and what have i to do after that?
...
Possible Duplicate:
The Definitive C Book Guide and List
>Can you suggest any book or website which is best to learn ansi c.
(in more detailed information,more examples and questions)
...
I have the following code:
#pragma omp parallel sections private(x,y,cpsrcptr) firstprivate(srcptr) lastprivate(srcptr)
{
#pragma omp section
{
//stuff
}
#pragma omp section
{
//stuff
}
}
According to the Zoom profiler, two threads are created, one thread executes both the sections, and the other ...
I've just been going back over a bit of C studying using Ivor Horton's Beginning C book. I got to the bit about declaring constants which seems to get mixed up with variables in the same sentence.
Just to clarify, what is the difference in specifying constants and variables in C, and really, when do you need to use a constant instead of...
I want:
111 || 100 ---> 111, not 1
100 && 100 ---> 100, not 1
101 && 010 ---> 000, not 0
Broken code
#include <stdio.h>
main(void){
string hexa = 0xff;
strig hexa2 = 0xf1;
// CONVERT TO INT??? cast
int hexa3 = hexa || hexa2;
int hexa4 = hexa && hexa2;
puts(hexa3);
puts(...
In C there is a do while loop and pascal's (almost) equivalent is the repeat until loop, but there is a small difference between the two, while both structures will iterate at least once and check whether they need to do the loop again only in the end, in pascal you write the condition that need to met to terminate the loop (REPEAT UNTIL...
I have a C project that produces ten executables, all of which I would like to be linked in statically. The problem I am facing is that one of these executables uses a 3rd-party library of which only the shared-object version is available.
If I pass the -static flag to gcc, ld will error saying it can't find the library in question (I p...
Is there a signal that is emitted when a window/dialog is presented in GTK+?
Example: when issuing this command to the GTK widget dialog:
dialog.present()
is there a resulting signal? Or is there any signal that denotes the "showing" of a window/dialog?
...
I've been working on this program for five months now. Its a real time application of a sensor network. I create several linked lists during the life of the program and Im using malloc for creating a new node in the link. What happens is that the program suddenly stops or goes crazy and restarts. Im using AVR and the microcontroller is A...
Is there a way to use set_active on a gtkCheckButton but without the user being able to press/toggle the said button?
In other words, I want to programmatically control the active state of the CheckButton but I don't want the user to be able to change it.
...
If I want to check that positive float A is less than the inverse square of another positive float B (in C99), could something go wrong if B is very small?
I could imagine checking it like
if(A<1/(B*B))
but if B is small enough, would this possibly result in infinity? If that were to happen, would the code still work correctly in al...
Basically I have a class and it is instincable (not static). Basically I want the class to be able to generate its own threads and manage its own stuff. I don't want to make a global callback for each instance I make, this doesnt seem clean and proper to me. What is the proper way of doing what I want. If I try to pass the threadproc to ...
I have a thread that sets a value to true when it is done. Until then I wait:
while(1)
{
if(done[0] == true)
{
break;
}
}
This code works just fine in Debug but in Release it stays in the loop forever even though the debugger clearly says that it is true and not false.
Why would this not work?
Thanks
...
I am trying to modularize a function that used to add values to multiple structures in one call. Now I want to do one value addition per call, but I am not sure how to make a less specific argument reference.
func ( [?] *val )
{
}
...
I created a function similar below in delphi code. but it wont work. What is the proper way to convert this?
char* ReadSpeechFile(char* pFileName, int *nFileSize)
{
char *szBuf, *pLinearPCM;
int nSize;
FILE* fp;
//read wave data
fp = fopen(pFileName, "rb");
if(fp == NULL)
return NULL;
fseek(fp, 0,...
Hello,
GNU Emacs 23.1.1
I am just wondering is there any feature in emacs where I can find out what functions call a specific function.
In my code, I normally have to do a search on the function name to see what functions calls it.
It would be nice if I could display all the names of the functions where this specific function is bein...
Possible Duplicate:
Use the keyword class as a variable name in C++
In a C header file of a library I'm using one of the variables is named 'new'. Unfortunately, I'm using this library in a C++ project and the occurence of 'new' as a variable names freaks out the compiler. I'm already using extern "C" { #include<...> }, but th...
Hi all,
I need clarifications on using libcurl for the following:
I need to send an http HEAD request shown as below ::
HEAD /mshare/3/30002:12:primary/stream_xNKNVH.mpeg HTTP/1.1
Host: 192.168.70.1:8080
Accept: */*
User-Agent: Kreatel_IP-STB
getcontentFeatures.dlna.org: 1
The code I wrote (shown below) , sends the HEAD Request in ...
I'm writing some code (some of which uses W3C's libwww) in C. It's been a while since I've touched ANSI C. Back in the day we rolled our own test framework. Does anybody here have any test frameworks that they recommend for C programming?
Googling around I was inclined to go with Check. It has a page on other unit testing frameworks in ...