I have this XML tree that looks like this (I've changed the tag names but if you're really clever you may figure out what I'm actually doing.)
<ListOfThings>
<Thing foo:action="add">
<Bar>doStuff --slowly</Bar>
<Index>1</Index>
</Thing>
<Thing foo:action="add">
<Bar>ping yourMother.net</Bar>
<Index>2</In...
I have a situation where I have to print out a NUL character if there is no action in a part of my program. Take for example the code below:
char x = '\0';
...
printf("@%c@\n", x);
I want it to print this:
@@
but it prints out
@ @
Whats the correct way not to have the \0 character printed out a space as above?
...
I would like to build some code which calls some code on loadup of the shared library. I thought i would do it like this:
#pragma init(my_init)
static void my_init () {
//do-something
}
int add (int a,int b) {
return a+b;
}
So when i build that code with
gcc -fPIC -g -c -Wall tt.c
It returns
gcc -fPIC -g -c -Wall tt...
is it possible to find out the page size of a processor using C program and malloc?
and not by using sysconf() call?
...
hi i have a file having svn diff i wish to extract the filenames form the diff.
How to write the parser for that..
Index: libs/constant.php
===================================================================
--- libs/constant.php (revision 1243)
+++ libs/constant.php (revision 1244)
@@ -26,5 +26,5 @@
// changesss
-
+// test 2
?>
\...
pthread_t thread1;
pthread_create(&thread1,NULL,.......,NULL);
// Here I want to attach a thread to a member function of class
How can I pass the member function of a class in the above code.
...
how to write a program that reads in a list of integers from a
text file, print them out to another file in a formatted fashion?
...
How to put * in the password field when user enter the password.
Like in turbo we can use getch() but it is not available in gcc.
Give me the other way
...
Hi,
Is there any way to find particular C language function's input and output parameters from a framework (apple's ARM) during the runtime or from any method with out knowing the headers.
It is a framework and there are no header files for it.I decompile it with IDA Pro and it gives me the function names but not input and output para...
This thread can be treated as a sister thread of previous one posted by me as well. It's will be very tedious that when you want to bind a link local adress to a ipv6 socket you need to the set sin6_scope_id
field of sockaddr_in6 struct as well. I'm wondering if someone can provide a good practise like solution here for me or anyone who ...
I have console application in c. I want to convert into window application, kindly guide me so that I can make it possible.
...
Hi,
I'm trying to write a client/server program with threads. I close the socket once the connexion is finished. The servers gets plenty of new connexions, and the socket number (file descriptor) increases very quickly: after 5 minutes running I was already at around file descriptor number 800!
Is this a normal thing?
Do threads share...
Can anybody point me to a good OCI quick tutorial? I took a tour of official Oracle documentation, but it is really huge (and I know OCI deserves every line of it, anyway).
Since I'm starting off with OCI I would like to have something more brief to play around with initially, and by which I can figure out how this interface works.
A...
Is there a simple way?
...
i have a task to transfer text files from one pc to another using FTP , i need some directions how can it be done in ansi c as its user requirement to do it in ansi c
windows palte form so windows libs may also be used ..............
looking for help!
...
Hi
I am new to pointers in C. I know the basic concepts. In the below code, why is it printing the "ink" as its output?
#include<stdio.h>
main()
{
static char *s[]={"black","white","pink","violet"};
char **ptr[]={s+3,s+2,s+1,s},***p;
p=ptr;
++p;
printf("%s",**p+1);
}
Thanks
...
Why is calling a standard library function inside a signal handler discouraged?
...
By default, printf() seems to align strings to the right.
printf("%10s %20s %20s\n", "col1", "col2", "col3");
/* col1 col2 col3 */
I can also align text to the left like this:
printf("%-10s %-20s %-20s", "col1", "col2", "col3");
Is there a quick way to center text? Or do I have to write a funct...
I have a huge global array of structures. Some regions of the array are tied to individual threads and those threads can modify their regions of the array without having to use critical sections. But there is one special region of the array which all threads may have access to. The code that accesses these parts of the array needs to car...
#include <stdio.h>
int main() {
char read = ' ';
while ((read = getchar()) != '\n') {
putchar(read);
}
return 0;
}
My input is f (followed by an enter, of course). I expect getchar() to ask for input again, but instead the program is terminated. How come? How can I fix this?
...