Search:

Type: Posts; User: deprekate

Search: Search took 0.00 seconds.

  1. Replies
    16
    Views
    4,867

    Ah -'0' worked, I was trying it without the...

    Ah -'0' worked, I was trying it without the single quotes.

    arr[n] = (double)line2[j]-'0';
    Is -'0' preferable to -48? will it always give me the correct answer?

    I was debating just doing a...
  2. Replies
    16
    Views
    4,867

    Yes although I believe I tried the -'0' method...

    Yes although I believe I tried the -'0' method and it did not work. I had to subtract 48: hence the


    (double)line2[j]-48
  3. Replies
    16
    Views
    4,867

    So I take the string C001:1001:1 and I want to...

    So I take the string C001:1001:1 and I want to get teh 1001 part. and then I want to get each of the characters of 1001. So "1","0","0","1". and I will be putting these into a double array. ...
  4. Replies
    5
    Views
    5,451

    Thanks for all the replies/help. So it appears I...

    Thanks for all the replies/help. So it appears I am allocating the correct way? but when I run something unexpected(line2[1][100000]) I am jsut getting a random event idiosyncracy?
    So basically...
  5. Replies
    5
    Views
    5,451

    dynamic 2D array allocation

    So I am revisting some of my old code and I was creating 2D array dynamically in 2 different ways:


    double **allocate_array(int row_dim, int col_dim){
    double **result;
    int i;
    ...
  6. Replies
    16
    Views
    4,867

    No I want to take the second term(1001) of that...

    No I want to take the second term(1001) of that line(: are delimiters), and then pull out each character of that term("1","0","0","1") each into its own variable.

    So I want to cast a single...
  7. Replies
    16
    Views
    4,867

    I tried both ways: ...

    I tried both ways:


    printf("char :i=%d,j=%d and value=%c\n",i,j,line2[j-1]);
    printf("float :i=%d,j=%d and value=%f\n",i,j,line2[j-1]);
    ...
  8. Replies
    16
    Views
    4,867

    trouble casting char to double

    Hi I have the following code:


    i = 1;
    while (fscanf(infile, "%[^:]:%[^:]:%s\n", line1,line2,line3) != EOF) {
    printf("Line was composed of %s, %s, %s\n",line1,line2,line3);
    ...
Results 1 to 8 of 8