Trapping ALT - 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

Re: array filling problem

1999-04-20 Thread Anubhav Hanjura
Although C does not do array subscript checking , some compilers like mine sun workshop c/c++ 4.2]  say "cannot access memory location xyz..." when trying to access memory beyond the [subscript - 1 ] element in an array. anubhav -Original Message- From: Darius Blaszijk <[EMAIL PROTECTED

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   #includeint 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  

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

Arrays is confusing

1999-04-08 Thread Anubhav Hanjura
Why does this code give the strange output they give?      #includemain(){ 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

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 #include int numbitset(unsigned int x,unsigned int y) { unsigned int a=0; unsigned int b=0; register int asetbit=0; registe

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 S

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- #include unsigned int numbitset(unsigned int x) {

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 ___

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

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 a

Fw: Utils

1999-02-22 Thread Anubhav Hanjura
I have a related problem. Is there any utility or combination of unix commands which enables me to trace the dependency of a binary to its constituent C/C++/header source files. eg. if i have a binary that is named "my_binary" and is made from main.c my_header.h ... this utility should print or g

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   

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