Search:

Type: Posts; User: slowcoder

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    2
    Views
    1,928

    Ah, such stupid mistakes! I wasn't paying close...

    Ah, such stupid mistakes! I wasn't paying close enough attention to what I was doing. Thank you Salem!
  2. Replies
    2
    Views
    1,928

    Problem Writing to Text File

    For all list_count entries, I would like to print out e_list to a text file. However, I receive the error: "warning C4133: 'function' : incompatible types - from 'struct _iobuf *' to 'const char *"...
  3. Replies
    3
    Views
    1,773

    maxorator, thank you for the explanation; it...

    maxorator, thank you for the explanation; it makes a lot more sense now. Worked perfectly :)
  4. Replies
    3
    Views
    1,773

    Write to a Text File

    Within this function:


    static void horiz_edge(void)
    {
    int y;
    int line_no;
    int current;
    int *pe_ptr;
    int *ne_ptr;
  5. Replies
    7
    Views
    1,635

    So just to verify that I interpreted that...

    So just to verify that I interpreted that properly, this would be the equivalant?


    int multi_tile, norec, opt_DM;

    /*some code*/

    if ((norec != 0) && (opt_DM < 32))
    multi_tile = 1;
    else
  6. Replies
    7
    Views
    1,635

    Perfect, thank you for all the explanations. ...

    Perfect, thank you for all the explanations.

    One more simple question that is similar.


    int multi_tile, norec, opt_DM;

    /*some code*/

    multi_tile = norec && opt_DM < 32;
  7. Replies
    7
    Views
    1,635

    Simple Explanation Needed

    When something like this is done in C:


    int i;
    const static char phase[] = "urrrddd";

    for (i = 0; phase[i]; i++)
    {
    /* some code */
    }
  8. Replies
    12
    Views
    3,795

    Thank you vart, that worked perfectly :) ...

    Thank you vart, that worked perfectly :)

    brewbuck, I did a search about allocating the memory dynamically and found this post below. However, is this the best way to do it? I have a hard time...
  9. Replies
    12
    Views
    3,795

    brewbuck, I'm going to use something similar to...

    brewbuck, I'm going to use something similar to what you had:


    const char validCharacters[] = "0123456789ABCabc";

    int isCharValid(int ch)
    {
    return strchr(validCharacters, ch) != NULL;
    }
  10. Replies
    12
    Views
    3,795

    Thanks for everyone's input! It's greatly...

    Thanks for everyone's input! It's greatly appreciated.

    I've gone through all the examples and have played around with the code to understand it better. The one question that came up was how can...
  11. Replies
    12
    Views
    3,795

    How to Validate an Input

    I'm teaching myself C, and I've never had to deal with user input before so I need some assistance. For the program I want to create, a user is allowed to input any amount of numbers (no negatives)...
  12. Replies
    15
    Views
    2,798

    nevermind...i figured it out...just needed to use...

    nevermind...i figured it out...just needed to use the function strncat()...found an online tutorial that gave me the answer...
  13. Replies
    15
    Views
    2,798

    I have a program that I've been using as...

    I have a program that I've been using as reference (not written by me and fully works), and I noticed that there's a line of code:


    *txt_ptr++ = '\\';

    where \\ is added to the end when it gets...
  14. Replies
    15
    Views
    2,798

    Adak, I read that page over and the explanation...

    Adak, I read that page over and the explanation wasn't totally clear.

    In my program, I changed it to:


    encodation = encodeB(dataCharacter1, j);
    encodation++;

    but when I did: ...
  15. Replies
    15
    Views
    2,798

    Reading the book over and over, it seems that...

    Reading the book over and over, it seems that this line below should work, because it increments the pointer. However, this line doesn't work either. Still confused.


    *encodation++ =...
  16. Replies
    15
    Views
    2,798

    robatino, thank you for the links. I changed my...

    robatino, thank you for the links. I changed my main function accordingly and bookmarked that page for future reference so I don't make that mistake again. I'm still digesting the malloc page, and...
  17. Replies
    15
    Views
    2,798

    I plotted everything out on paper and I guess I...

    I plotted everything out on paper and I guess I just don't know enough about C to get my result. When I translated my steps, the compiler does not like my syntax.

    For the function: char...
  18. Replies
    15
    Views
    2,798

    MacGyver, thank you for the explanation. I'm...

    MacGyver, thank you for the explanation. I'm teaching myself how to do everything via the internet and the C Programming Language book...guess I'm not teaching myself that well :(

    Stepping...
  19. Replies
    15
    Views
    2,798

    So are you saying I need to change this function:...

    So are you saying I need to change this function:


    char encodeB(int dataCharacter, int position)
    {
    char bEncodation[2];

    if (dataCharacter == 0)
    {
    if (position == 0)
  20. Replies
    15
    Views
    2,798

    Basic Help with Arrays and Output

    Okay, here's a simplified version of my program:


    /* INCLUDES */
    #include <stdio.h>

    int lookupTable(char dataCharacter1, char dataCharacter2);
    char encodeB(int dataCharacter, int position);...
  21. C to VB: What would void * equate to in VB?

    I'm hoping a C programmer will know the answer to this:

    I have to convert some C code into VB: What would void * equate to in VB?

    ex:
    void *JOutput;

    Thanks!!
  22. Replies
    3
    Views
    1,722

    Thanks Salem...I was trying to be more...

    Thanks Salem...I was trying to be more complicated then what was really called for :)
  23. Replies
    3
    Views
    1,722

    int and char concatenation question

    char *t_ptr;
    int *ts;

    case 555:
    strcpy(t_ptr, "\\555\\");
    t_ptr += 5;
    strcpy(t_ptr, (char *) ts);
    break;

    I just need to concatenate t_ptr and ts, but my line of code: strcpy(t_ptr,...
  24. Replies
    5
    Views
    1,150

    I just want my output to be \927\ rather than...

    I just want my output to be \927\ rather than \:927\

    I'll try to get all the code that has to do with the output...unfortunately there's a lot of code that I have to sort through to figure out...
  25. Replies
    5
    Views
    1,150

    strcat() added an unnecessary colon

    *txt_ptr++ = '\\';
    *txt_ptr++ = (char)strcat(txt_ptr, "\\927\\");

    I have these two lines of code within my program and the output I would hope to get would be: \927\

    However, the output I get...
Results 1 to 25 of 50
Page 1 of 2 1 2