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 strongm 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. dlkfjdlkfjdlfkd

    Searching for a set of chars a string

    Replace strcmp with strstr.
  2. dlkfjdlkfjdlfkd

    C Code Failing on an "fgets" Call

    I'm afraid it's too generalized. You should try to cut your code down to the smallest, compilable example that demonstrates the problem. This process, while probably painful, might reveal the problem. It seems likely that the function you're calling is doing something that you don't realize...
  3. dlkfjdlkfjdlfkd

    Trouble passing arrays between functions.

    You need to allocate memory for a inside polyfit: double* polyfit(double* x,double* y,long order,long n) { double *a = malloc(sizeof *a); ... ... return a; }
  4. dlkfjdlkfjdlfkd

    Print on Usb0001

    Assuming you're on a Windows platform, see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_62ia.asp
  5. dlkfjdlkfjdlfkd

    Read data from the web

    ...the body into a buffer. Hope it helps. #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <curl/curl.h> static unsigned char *body; static size_t body_size; static size_t body_capacity; #define INIT_BODY_SIZE 1024 size_t do_body(void *ptr, size_t size, size_t nmemb, void...
  6. dlkfjdlkfjdlfkd

    Logic &amp; switch statement

    ...(how often the function is called) and the project requirements are some of the things that will determine whether or not that memset will be worthwhile or not. Don't get me wrong, intialization is a *good* thing, generally. I just wanted to point out that it is not *always* best practice.
  7. dlkfjdlkfjdlfkd

    Logic &amp; switch statement

    It's certainly debatable if an initialization constitutes &quot;good programming practice&quot; in all instances, particularly if that initialization constitutes a hit on runtime performance.
  8. dlkfjdlkfjdlfkd

    Logic &amp; switch statement

    Why would he need memset there?
  9. dlkfjdlkfjdlfkd

    Logic &amp; switch statement

    The closest you can come is to use multiple case statements and take advantage of &quot;fall-through&quot;: case 'T': case 'V': case 'K': /* do something */ break; If you don't plan on modifying the contents of proddir, you can do what rwb suggested and change proddir to a pointer and...
  10. dlkfjdlkfjdlfkd

    what does the format specifier %n do?

    Incidentally, if %n weren't specified by the C standard (it is, as manvid points out), we don't know how printf will behave when encountering it. The implementation might provide a meaning for it or it might not. Your program might conceivably crash if you pass printf an unrecognized conversion...
  11. dlkfjdlkfjdlfkd

    Logic Suggestion

    ...struct person { char name[MAXNAME + 1]; char state[3]; } persons[MAXPERSONS]; int person_count; to insert: int person_insert(const char *name, const char *state) { struct person p; strcpy(p.name, name); strcpy(p.state, state); if (person_count == MAXPERSON) return -1...
  12. dlkfjdlkfjdlfkd

    hi guys I am reading a file and pri

    If you want to be careful not to offend anyone, you might try &quot;Hey you all&quot; or &quot;Hey y'all&quot;. :)
  13. dlkfjdlkfjdlfkd

    Quick question about typedef XXXXX:size_type, vectors, etc.

    You're right in that you can use vectorname.size() inside the conditional, rather than assign it to a variable and then test the variable in the condition. I believe in most of the examples the author creates a typedef and uses that typedef in two or more cases throughout the program, so that...
  14. dlkfjdlkfjdlfkd

    pointer notation convention

    I use int *pint; Only because this has become the de facto convention. Neither one is inherently better.
  15. dlkfjdlkfjdlfkd

    restricting users file access

    I'll admit that my earlier comments did constitute a &quot;casual review&quot; and I retract my statements comparing rot13 to butthead's algorithm. I glanced over the code, without taking note that a key was being used and thought that it amounted to simple letter substitution. My apologies to...
  16. dlkfjdlkfjdlfkd

    restricting users file access

    You asked me to decipher the message using rot13, so I did, but it still doesn't make any sense to me.
  17. dlkfjdlkfjdlfkd

    restricting users file access

    Okay... qsI^[$k:o\[r15U|C_!Q]SlUvT*T,j%*&F2ho)L@70u+d ?K]mJk*c!@%iq#i(J2@e93!7?]s'( <4IRLb|C%aSfWwGVP2u I'm afraid I don't see your point.
  18. dlkfjdlkfjdlfkd

    atoll( ) problem

    atoll isn't part of C89, but is part of C99 (the new C standard). However, most C compilers are C89 compilers and therefore may not provide atoll. See the compiler documentation and see the linker options mentioned in the diagnostic. If your compiler doesn't provide it, there may be atoll...
  19. dlkfjdlkfjdlfkd

    Bitfield querry ....

    Thanks guys :)
  20. dlkfjdlkfjdlfkd

    restricting users file access

    No offense, but you'll want to use something else unless you're satisfied with the cryptographic strength of rot13.

Part and Inventory Search

Back
Top