forward referencing a structure1143 (8/14/2010 10:12:39 AM) comp.lang.c Hi,
Following code is showing "error: field 'c' has incomplete type"
on compiling
struct a
{
struct b c;
};
struct b
{
int v;
};
but following code is fine
struct a
{
struct b *c... Tagore
sort & Parition Data269 (7/22/2010 12:41:47 AM) comp.programming Hi, I am making a message application where I need to sort and partition messages according to sender names. All my message records are stored in a large array. I am looking for an in-place and stable sorting ... Tagore
data structure for sorting a list of pairs5124 (5/30/2010 5:22:39 PM) comp.lang.c++ Hi,
I want to sort a list of pairs based on key values. e.g. If my pairs
are like
(4,3)
(2,8)
(3,10)
(19,23)
(13,14)
then I would like to sort this with final list as:
(2,8)
(3,10)
(4,3)
(13,14)
... Tagore
different behavior of empty struct & enum9187 (4/27/2010 12:46:24 AM) comp.lang.c Hi,
when I try to declare an empty structure, there is no error as in
below
struct a{
};
however, when I try to declare an empty enum it shows error as in
enum a{
};
Why are different behav... Tagore
string literal declaration7195 (4/20/2010 12:58:08 AM) comp.lang.c Hi,
I was trying to understand some code and came across a string
literal definition as:
char a[]="abc""def"; // string-1
I had seen eariler only string literal with characters in a single
pair... Tagore
use of #define MACRO(A,B)7147 (3/31/2010 12:55:32 AM) comp.lang.c hi,
While understanding some code, I came across a definition of macro
without expansion
#define MACRO(A,B) // expansion missing
What could be use of such macro?
I think, there is no use of it w... Tagore
Initializing a list11172 (12/11/2009 12:30:22 AM) comp.lang.c hi,
If I want to initialize a list of numbers to be used in a program.
like
const int arr_List[]={34,12,67,34};
but t I have to also declare its size explicitly.
const int size=4;
Now problem is t... Tagore
Pointer and string literal question17132 (12/10/2009 10:51:40 PM) comp.lang.c hi,
#include
int main(void){
char *s="LET";
char *t="LET";
if(s==t)
printf("same");
else
printf("different");
return 0;
}
In a... Tagore
K random numbers2443 (11/16/2009 2:04:25 AM) comp.lang.c hi, I want to generate k different random numbers between 1 to n. (k<n). One of the appraoch is calling random function again and again. and checking wheter new generated number had already been generated. bu... Tagore
combination of a string and queries228 (12/23/2008 8:15:41 PM) comp.lang.c I have written following recursive function for finding combinations of a string str with i characters. void combi(char *str,int i) { int len=strlen(str); static char cstring[20]; //this string stores combi... c.lang.myself(94)
char is signed or unsigned?1142 (12/28/2008 8:29:58 PM) comp.lang.c I found following program in a C forum: ---------------------------- #include int main() { char i; for (i=0;i<=120;i+=10) printf("%d\n",i); } ------------------------ there w... c.lang.myself(94)
printf query828 (1/21/2009 5:01:13 PM) comp.lang.c Please consider following program: #include int main(void) { int i=43; printf("%d",printf("%d",printf("%d",i))); return 0; } When I run above program, I get output as 4321 which is not as expected ... c.lang.myself(94)
Any differnece between functions1745 (1/23/2009 10:12:14 PM) comp.lang.c Recently I was having a chat with my friend about standard way of writing main function in C. We were at loggerheads about whether there are any differences between following two methods.. int main(void) { } i... c.lang.myself(94)
structure without any data448 (3/7/2009 2:31:53 PM) comp.lang.c I am trying to understand a source code for a project. It uses a structure without any body ( variables) defined in it i.e in following form struct ABC; then it casts this structure to some pointer variable...... c.lang.myself(94)
pointer to const int3844 (4/2/2009 10:33:59 PM) comp.lang.c Please consider following program: #include int main() { const int x=5; int *ptrx; ptrx=&x; *ptrx=10; printf("%d",x); return 0; } Output of this program is 5 which shows that value at o... c.lang.myself(94)
integer and floating point casts queries1744 (12/8/2008 6:29:42 PM) comp.lang.c hi, I went through following program in a C puzzle book. #include #define PR(x) printf("x=%.8g\t",(double)x); #define NL putchar('\n'); #define PRINT4(x1,x2,x3,x4) PR(x1) PR(x2) PR(x3) PR(x4) NL main() { ... c.lang.myself(94)
sorting of records with 0 and 1.5034 (12/17/2008 1:36:18 PM) comp.programming we have an array of n data records to sort and that the key of each record has the value 0 and 1. The in place sorting algorithm must be stable and run in o(n) time. ... c.lang.myself(94)