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!

Search results for query: *

  • Users: Lim
  • Order by date
  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.
  16. Lim

    Creating tar from list, incorect tar ?

    HP-UX 11. I have list of files I want to tar, they all in one directory, so I do next : cat archives/9/9.filelist_exec_NT40_INTEL.win32|xargs tar cvf mytar.tarit it prints: a projbin/NT40_INTEL.win32/file1 5 blocks a projbin/NT40_INTEL.win32/file2 258 blocks .... all files frommy list. The...
  17. Lim

    Pointers and Multidimensional arrays

    double value1[i]; double value2 [i][j]; double *p1 = value1; <- pointer to double. double *(p2)[j] = value2; <- pointer to array of j doubles; Now the difference: p1+1 -> will make a shift in memory to size of one double and we will have pointer to second element of array value1[1]. p2+1 will...
  18. Lim

    Problems of float or double calculations being not quite exact.

    Looks fine. May be some platforms have problem with: float sum; Try it make double sum; Also intsum = (int)sum; and most important: if ((sum - (double)intsum) == 0.) If it will not help post yours output.
  19. Lim

    Reposition array base pointer

    Funny about int a[10]; that a,&a[0] and &a will have the same value if you pass it as function argument. rbobbit right, 'a' is not a simple pointer. For example &a is not a double pointer, it's still single. Compiler will ignore '&' for 'a'.
  20. Lim

    Problem with malloc

    show your code.

Part and Inventory Search

Back
Top