Search:

Type: Posts; User: Albinoswordfish

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    2,516

    Oh ok now I see, thanks for the reply

    Oh ok now I see, thanks for the reply
  2. Replies
    4
    Views
    2,516

    What does Malloc do?

    Now I've read this thread: http://cboard.cprogramming.com/c-programming/30324-what-does-malloc-do.html

    I already know from the high-level perspective what malloc does. However I want to know how...
  3. Replies
    0
    Views
    765

    Semaphore question

    I guess I just learned about this new type of variable called a semaphore. I'm reading about it on wikipedia however I still don't get the clear picture..

    What would be an example of when a...
  4. Replies
    14
    Views
    4,069

    But the OP is using character by character...

    But the OP is using character by character comparisons, so using if(string[0] == string[4]) is perfectly legit, the [] is already dereferencing the pointer.
  5. Replies
    5
    Views
    4,847

    Well in your while loop when you check if your...

    Well in your while loop when you check if your buffer is equal to "quit\n" you can add a break statement to exit out of your while loop. However maybe I'm misinterpreting your problem and your...
  6. Replies
    0
    Views
    4,467

    WebClient Uploadstring method

    I have a quick question,

    lets say I have this two lines of code:



    this.myWebClient.Headers.Set(HttpRequestHeader.ContentType, "text/xml");
    string response =...
  7. Replies
    1
    Views
    1,598

    retrieving integers from a buffer

    Right now I'm trying to create a UDP ping server. The client is basically going to send data in this format:
    (4 byte integer): (text string)

    I'm using the recvfrom() function to store data into...
  8. Getting segmentation fault with strtok()

    Right now I'm trying to parse a CSV file however I keep receiving a segmentation fault. Below is part of my code where it is happening.



    count = 1;

    while(1){
    if(count == 20) break;
    ...
  9. oh wow I'm dumb, thanks a lot I've been wrestling...

    oh wow I'm dumb, thanks a lot I've been wrestling with this problem for an hour now.
  10. problem with a function I'm trying to write

    I'm trying to write a function that inserts an 'x' where ever two consecutive ',' appears in a string. Here is my function I have below:



    void insertx(char * string){
    char prev;
    char curr;...
  11. Replies
    3
    Views
    3,628

    Here is my entire code: void stripnew(char...

    Here is my entire code:



    void stripnew(char *);

    int main(void){
    FILE * fptr;
    char c[1000];
    char ** file;
  12. Replies
    3
    Views
    3,628

    problems with strtok()

    Right now I'm having a problem using the strtok() function, it's giving a segmentation fault for some reason and I don't know why.



    curr = strtok(file[0],",");

    while(1){
    curr =...
  13. Replies
    8
    Views
    1,639

    oh it might be cause my test initializations...

    oh it might be cause my test initializations we're declared out of range of my declaration of test. But would that affect other variables?
  14. Replies
    8
    Views
    1,639

    why doesn't this work (confused)

    I have an
    int rownum //which is globally defined

    in main I have



    rownum = 0;
    test[0][0] = '[';
    test[0][1] = '1';
  15. Well I know what the vector table for the hsc12...

    Well I know what the vector table for the hsc12 looks like. However I'm not quite sure how to build the actual table. This is what I have now.



    typedef void (*near tIsrFunc)(void);
    const...
  16. Well actually more specifically I want to know...

    Well actually more specifically I want to know how to build a interrupt vector table.
  17. Interrupt Service Routine for microcontroller

    Right now I'm using codewarrior to program a hsc12 microcontroller using C. I want to figure out how to write ISRs (Interrupt Service Routines). The include file that comes with codewarrior has names...
  18. Replies
    2
    Views
    1,132

    How preprocessor works

    I thought I knew how the preprocessor worked until I ran until a recent problem.

    Say I have the declaration below:



    #define INFILE dataset


    then later in my main function I have
  19. Replies
    14
    Views
    1,531

    well lets say your given a string that is not...

    well lets say your given a string that is not null terminated would it still be possible with pointer arithmetic
  20. Replies
    14
    Views
    1,531

    I was just wondering if there was a standard...

    I was just wondering if there was a standard function I could use
  21. Replies
    14
    Views
    1,531

    getting a char from a string

    I know I can use pointers to get every character from a particular string such as



    char * string = "hello";
    char * i;
    i = string;
    for(;*i != '\0'; i++)
    {
    printf("%c",*i);
  22. Replies
    14
    Views
    5,162

    lets say instead of MAXINT I put in a negative...

    lets say instead of MAXINT I put in a negative number, however I want my program to not compile if this is the case how would I go about doing that?
  23. Replies
    14
    Views
    5,162

    Assert command

    I had an interview a while ago, one of the questions had to do with the assert command.

    Lets say I had the below statement:


    //main
    assert(foo(MAXINT)) //is this the correct usage of assert?...
  24. Replies
    3
    Views
    4,496

    This is a pretty basic link list example,...

    This is a pretty basic link list example, basically I think of a link list as an object that contains two things 1. A data entry 2.Pointer(s) to another object of the same type. This pointer(s)...
  25. Replies
    3
    Views
    14,714

    well can you use the math.h library which has the...

    well can you use the math.h library which has the function pow(x,y) where
    x^y in mathematical terms.

    edit: I'm not quite sure what ^ does, I know it doesn't do exponentials but if someone could...
Results 1 to 25 of 27
Page 1 of 2 1 2