Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Lim

  1. Lim

    Struct question

    On the same platform you can do this. Also you can have holes (padding) inside or at the end of structure. You still should be fine if you will read saved data back in the same structure and do not try to read value of one field based on shift.
  2. Lim

    HP 11.11 ansi compiler 3.45 + Rational Purify

    Thanks RanganathRamachandra.
  3. Lim

    understanding char arrays...

    I think char *text[][7] should work. 7 is the lenght of char in string, yes not a *text[][3][7] and *text[][7] and text[][3][7] is the same in your case. the only difference in first case you can cheat compiler and ommit two dimensions. char *text[][3] = ... in this case space got allocated but...
  4. Lim

    understanding char arrays...

    Your problem that you thought that your definition allocate space specificly for you strings, but it counting number of 2 dimensional arrays [3][3] and it 3, so you have array text[3][3][3]. In C you can not allocate array with different lenght of elements, if at least one string is 7 chars, all...
  5. Lim

    understanding char arrays...

    const char *text[3][3] = { { "Hello", "I'm", "the"}, {"sample", "char", "array"}, { "and", "I'm", "mean"} you have only [3] array for each of your string, so each string is no more...
  6. Lim

    "Clearing" a string

    No, my favourite: int a[3]; 1[a]=2; printf("%d",a[1]); ==> 2 :)
  7. Lim

    "Clearing" a string

    I was talking about 4 bites in one elliment A[0], yes all together it will be 20. Making my point in HEX would not help to understand how -1 works.
  8. Lim

    "Clearing" a string

    Since we touched memset I want to add few words about this treaky function. It's good for initiating strings with any character, but you also can use it on any array integer, double ... or on any chank of memory, just be carefull!!! Somehow memset interface is missleading. Second argument...
  9. Lim

    Trouble passing arrays between functions.

    General advises. If you have function which allocate memory create another one to free it, like this: double* getpolyfit(double* x,double* y,long order,long n) void freepolyfit(double *a); And always check pointer to NULL before calling free. Better write own myFree(void *p); function which...
  10. Lim

    compiling header files

    When you use precompiled headers (for example MS C++, and HP aCC support it) you don't compile it directly anyway. You still have to create .c file and include your common header file and then compile it. But I am agree it's not a normal object file since there will be only empty declarations...
  11. Lim

    compiling header files

    Generally you should not compile any header files even user writen. Of cause you can put function implementation in header file and then you have to compile it, but this is WRONG design and you will not be able to include this file anywere, cause you will have double function difinitions during...
  12. Lim

    Great MISTERY, what does this mean? (hp error)

    Yep, It was broken make on HP. If I am building in deep directory (a lot of subdirectories) what is common for java modules and I have suffix rules it brakes make. I used workaround calling "make -r" to ignore suffix rulles. I even installed lates make patch - did not helped. Thnaks.
  13. Lim

    Great MISTERY, what does this mean? (hp error)

    One more. Pid 9389 rceived a SISEGV fo sack grow faire. ossibe aue: isfcet eory o swap space, or stac size exceeded assiz. Memory fault(coredump) Looks like something really broken. Any idea what can it be? This is happanning on two different HP-UX 11 boxes.
  14. Lim

    Great MISTERY, what does this mean? (hp error)

    Ok, I got htis error on HP-UX 11, from make file: -------------- Pid 2692 receive aSGSEGV or stac gothfilre. Posiecaue: nsufcit meoyor saspac, or tacszeexcededmaxsi. -------------- What is that?????? Some kind of slang?
  15. Lim

    Creating tar from list, incorect tar ?

    The problem - I don't need all files from this directory, I am making back up, so I need only files which changed and that why I am creating this list before archiving.

Part and Inventory Search

Back
Top