Trapping ALT -key combinations

1999-04-21 Thread Anubhav Hanjura
Hi All, I have a problem which I want to be addressed ASAP. I wrote earlier regarding this but most of the solutions were generalised and didn't meet my expectations. The problem is that I want to trap the ALT key combinations through a C program. I am running my programs on Solaris

Program error

1999-04-15 Thread Anubhav Hanjura
Trying to print *ip as a character when I apply post increment operator gives me 'D' and for pre-increment it gives me a bus error. Why? ---program code starts #includestdio.hint main(){ char *c_array; int *ip; c_array = (char *)malloc(100); strcpy(c_array,ABCDEFHIFGHIJKLMN); ip =

articles

1999-04-14 Thread Anubhav Hanjura
Hi All, I want to know if there are any magazines that publish articles on C language [ and not OR] C++ suppiled by software developers, practitioners like us all. I am thinking of putting in an article soon. Thanxa n u b h a v h a n j u r a

Trapping special characters

1999-04-09 Thread Anubhav Hanjura
Hi, How can I trap special characters like say ALT-A to ALT-Z from my program? I want the solution to be portable across platforms so that I can do the same on Windows also. Thanx in advance a n u b h a v h a n j u r a

Arrays is confusing

1999-04-08 Thread Anubhav Hanjura
Why does this code give the strange output they give? #includestdio.hmain(){ int i[4] ; int j = 0; i[j++] = j++; printf(%d %d %d %d\n,i[0],i[1],i[2],i[3]); return 0;} a n u b h a v h a n j u r a __E-Mail: [EMAIL

Re: Another bit question

1999-04-06 Thread Anubhav Hanjura
I hope this is what you want...After much thought I still feel uneasy about using two function calls per run. Is there any better method?? Meanwhile I am thinking of a better solution. ciao --program code- #includestdio.h unsigned int numbitset(unsigned

Re: Another bit question

1999-04-06 Thread Anubhav Hanjura
Hi, Just remove those two printf's which print value of a and b in the function numbitset() ciao, anubhav -Original Message- From: Glynn Clements [EMAIL PROTECTED] To: Anukool Lakhina [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Tuesday, April 06, 1999 10:14 AM

Re: Another bit question

1999-04-06 Thread Anubhav Hanjura
Here is another solution.. how was the first ?? I have not tested this extensively just for some sample values and it worked fine ciao, anubhav program code #includestdio.h int numbitset(unsigned int x,unsigned int y) { unsigned int a=0; unsigned int b=0; register int asetbit=0;

process creation

1999-03-31 Thread Anubhav Hanjura
Is there any other way to create a process other than fork / vfork() ? thanx in advance a n u b h a v h a n j u r a __ Work like you don't need money, Love like you've never been hurt, And dance like no one's watching

book on Malloc

1999-03-31 Thread Anubhav Hanjura
I have heard that there is a book dedicated to Malloc and memory management alone. Can anyone tell me the name publisher other details a n u b h a v h a n j u r a __ Work like you don't need money, Love like you've never

string function

1999-02-22 Thread Anubhav Hanjura
can somebody give an efficient algorithm for this string manipulation function. Concat two strings s1,s2 in which some last char's of s1 are same as the first few char's of s2 and we don't know how many. Write efficient code to concatanate these 2 strings so that the redundant char's

memory allocation

1999-02-18 Thread Anubhav Hanjura
If I have the following code: -- main() { char *filename; char *string = this is a string; strcpy(filename,string); printf(filename is %s\n,filename); } -- it gives me a segmentation fault when I compile it using one c++ compiler while on other it works

variable arguments

1999-02-18 Thread Anubhav Hanjura
I was just wondering, how is the case of variable arguments eg. in printf/scanf etc. implemented in linux? Also please suggest any good book on Unix/Linux internals. regds, Anubhav