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 Mike Lewis 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: *

  1. Marikallees

    Question on free()

    > will it be deallocated anyway since it is only in scope within the function? The only way you can be sure that the memory is released is to do it yourself with free. Many systems will release allocated memory when the program terminates, but that's not a requirement. > I seem to be getting a...
  2. Marikallees

    C vs Spreadsheets

    > Why war or factions? It's a pragmatics question, that's all... Stupid flames can arise out of the most practical of questions.
  3. Marikallees

    auto keyword

    > what's the keyword auto for? IIRC, auto was only used in a compiler symbol table. Other than that the only other possible purpose for auto is to format your declarations so that they match up vertically in the presence of other qualifiers: const int a; auto long b; static char c...
  4. Marikallees

    Socket Programming and passing data structures in stream

    > do I need to typecast the received buffer back into the original structure type? Yes. Type punning is tricky business, especially with structures and potential padding. As such, it's recommended that you typecast using pointers to unsigned char rather than char to avoid trap representations...
  5. Marikallees

    C vs Spreadsheets

    Yes, of course. But, as expected, it's not supported natively by the language. You would need to use a system API or third party library.
  6. Marikallees

    global variables in multiple c files

    Place a declaration in the header file of your choice that's to be included in each of the multiple files, then add a new file for the definition: /* foo.h */ extern int global; /* foo.c */ int global = 0; Include foo.h everywhere you need global, compile and link foo.c along with your other...
  7. Marikallees

    array

    The simple way is #define N 50 #define MAX_LENGTH 31 char names[N][MAX_LENGTH]; This gives you an array of 50 arrays of 30 characters. But if the maximum length of each name is 30 and the expected length is considerably less, you might be better off with dynamic allocation: #define N 50...

Part and Inventory Search

Back
Top