g_timeout_add (100, (GSourceFunc) read_next_packets, NULL);
I can feel the GUI response is slow because of the above statement.
How can I make it work asynchronously so that it doesn't affect the GUI response?
...
int Size(struct node* node)
{
if(node == NULL)
{
return 0;
}
else if(node != NULL)
{
return (Size(node->left) + 1 + Size(node->right));
}
}
Hi, can anybody please post the stack trace for the following piece of code.
Lets say if we insert the values 2, 1, 10, 5...
Then what could be the stack representa...
Whenever I run my program with fclose(outputFile); at the very end, I get an error. glibc detected...corrupted double-linked list
The confusing thing about this though, is that I have fclose(inputFile); directly above it and it works fine. Any suggestions?
FILE* inputFile = fopen(fileName, "r");
if (inputFile == NULL)
{
printf("in...
void forloop2()
{
int i = 0;
while(TRUE)
{
printf("forloop2\n");
}
}
int main() {
GtkWidget *window;
g_thread_init(NULL);
gdk_threads_init();
g_thread_create((GThreadFunc)forloop2, NULL, FALSE, NULL);
gtk_init(NULL, NULL);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show_a...
I'm trying to make a macro in C that can tell if a char is a hex number ( 0-9 a-z A-Z)
#define _hex(x) (((x) >= "0" && (x) <= "9" )||( (x) >= "a" && (x) <= "z") || ((x) >= "A" && (x) <= "Z") ? "true" : "false")
This what I've come up with but it won't work with a loop like this
char a;
for(a = "a" ; a < "z";a++){
printf...
void forloop2()
{
int i = 0;
while(TRUE)
{
printf("forloop2\n");
}
}
int main() {
GThread *Thread1;
GtkWidget *window;
g_thread_init(NULL);
gdk_threads_init();
gdk_threads_enter ();
Thread1 = g_thread_create((GThreadFunc)forloop2, NULL, TRUE, NULL);
gtk_init(NULL, NULL);
w...
Hello,
I am a very basic user and do not know much about commands used in C, so please bear with me...I cant use very complicated codes. I have some knowledge in the stdio.h and ctype.h library, but thats about it.
I have a matrix in a txt file and I want to load the matrix based on my input of number of rows and columns
For example, I...
hey folks,
I have this piece of code to test a shellcode but I don't understand it so can anyone explain it to me???
forget about the assembly shellcode, what i want to understand is the C code
char shellcode[] = "...";
int main(int argc, char **argv)
{
int (*func)();
func = (int (*)()) shellcode;
(int)(*func)();
}
I mean ev...
Hi,
I'm trying to read a large file (> 2.0 GB).
The seeking is done by lseek64, then I tried to read using read(fileHandle, buffer, bufferLength)\ pread64(fileHandle, buffer, bufferLength, offset) - but both return with -1.
What could it be?
Thanks in advance!
...
Hi..
I came across an article on Binary Trees Search .
It uses intensive Recursive Algorithms.. I am just so confused with these stuff..
Please guide my path so as I understand these problems at ease, or any good website to read about recursion first and then solving these problems.. Please share your experience on it..
Its very urge...
Hi... i have a little problem on my code...
HI open a txt that have this:
LEI;7671;Maria Albertina da silva;[email protected];
9;8;12;9;12;11;6;15;7;11;
LTCGM;6567;Artur Pereira Ribeiro;[email protected];
6;13;14;12;11;16;14;
LEI;7701;Ana Maria Carvalho;[email protected];
8;13;11;7;14;12;11;16;14;
LEI, LTCGM are the college;
7671,...
I was trying to figure out how much memory I can malloc to maximum extent on my machine
(1 Gb RAM 160 Gb HD Windows platform).
I read that maximum memory malloc can allocate is limited to physical memory.(on heap)
Also when a program exceeds consumption of memory to a certain level, the computer stops working because other applications ...
I need to answer a basic question from inside my C program compiled by GCC for Linux: how much of process heap is currently in use (allocated by malloc) and how much resides if free heap blocks. GNU implementation of standard library has mallinfo function which reports exactly what I need, but it only usable with 32-bit configurations an...
I am getting inling warning such as :
warning: inlining failed in call to ‘symbol_Arity’: call is unlikely and code size would grow
To get rid of this i changed the makefile removing the -Winline to get rid of this. I don't get any inlining warning. But , i don't know how wise is it to do in respect of performance. Can anybody plea...
I've got a button which when clicked copies and appends the text from a GtkEntry widget into a GtkTextView widget. (This code is a modified version of an example found in the "The Text View Widget" chapter of Foundations of GTK+ Development.)
I'm looking to insert a newline character before the text which gets copied and appended, such ...
Anybody out there has successfully installed PygraphViz on Windows?
Since there is not an official release for Windows, I'm trying to build it myself, but it fails to compile. I'm not the first one to face this issue, but I could not find an answer.
This is the console output:
C:\Python26\Lib\site-packages\pygraphviz-0.99.1>c:\python2...
Most of the times, the definition of reentrance is quoted from Wikipedia:
A computer program or routine is
described as reentrant if it can be
safely called again before its
previous invocation has been completed
(i.e it can be safely executed
concurrently). To be reentrant, a
computer program or routine:
Must hol...
Can anyone explain why this bubble sort function doesn't work and why I lose numbers in my output? I'm very new to C, so please forgive me if this is something very obvious I have missed.
#include <stdio.h>
#include <stdlib.h>
int bubble(int array[],int length) {
int i, j;
int temp;
for(i = 0; i < (length); ++i) {
for(j = 0...
Hi, stack. I've got a binary tree of type TYPE (TYPE is a typedef of data*) that can add and remove elements. However for some reason certain values added will overwrite previous elements. Here's my code with examples of it inserting without overwriting elements and it not overwriting elements.
the data I'm storing:
struct data {
int n...
Hello,
I want to transpose a matrix, its a very easy task but its not working with me :
UPDATE
I am transposing the first matrix and
storing it in a second one
The two
arrays point to the same structure
I
need two arrays (target and source)
so I can display them later for
comparison.
struct testing{
int colmat1;
...