Search:

Type: Posts; User: broli86

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    2,126

    I don't know, I need to do some mathematical...

    I don't know, I need to do some mathematical calculations in my project and I'm just debugging right now so that's why I'm using assertions.
  2. Replies
    9
    Views
    2,126

    trying to store a value at a NULL address may...

    trying to store a value at a NULL address may result in undefined behaviour. I think before the assignment takes place using an assert statement may be helpful :

    assert(vector_iterator(&v, axis)...
  3. Replies
    9
    Views
    2,126

    I understand what you are saying. I actually got...

    I understand what you are saying. I actually got this warning in many other programs when there was no return value specified at the end of the function. What is the solution or can I ignore this...
  4. Replies
    9
    Views
    2,126

    Is this program correct ?

    #include <stdio.h>

    typedef struct
    {
    double x, y, z;

    }vector;

    double *vector_iterator(vector *v, int axis)
    {
  5. Replies
    3
    Views
    4,801

    Initializing as in intiializing the members of...

    Initializing as in intiializing the members of edr. I intend to use only one ray variable and change the value of the members of the variable everytime I want to trace a new ray rather than use an...
  6. Replies
    3
    Views
    4,801

    Need help designing a recursive function.

    Hello I need some ideas for designing a recursive function for my ray
    tracing program.

    The idea behind ray tracing is to follow the electromagnetic rays from
    the source, as they hit the...
  7. Thread: re-calloc???

    by broli86
    Replies
    6
    Views
    3,514

    from what i hear, realloc cannot be used to...

    from what i hear, realloc cannot be used to downsize the array.

    although i have seen it happen quite often.
  8. Replies
    6
    Views
    2,476

    yes, i realised that error. #include...

    yes, i realised that error.



    #include <stdio.h>
    #include <stdlib.h>

    typedef struct node_s
    {
    void *data;
  9. Replies
    6
    Views
    2,476

    They print actual values correctly. I'm using...

    They print actual values correctly.

    I'm using digital mars compiler and used the -a option(strict ansi c/c++) and got no warnings or errors.
  10. Replies
    6
    Views
    2,476

    I changed my program to the following and its...

    I changed my program to the following and its working perfectly well :




    #include <stdio.h>
    #include <stdlib.h>

    typedef struct node_s
    {
  11. Replies
    6
    Views
    2,476

    have i written this program correctly ?

    #include <stdio.h>
    #include <stdlib.h>

    typedef struct node_s
    {
    void *data;
    struct node_s *next;

    }node;
  12. sorry, i realized it now and fixed it. It was a...

    sorry, i realized it now and fixed it. It was a silly mistake. Unfotunately, my pelles C compiler never reports such dangerous situations. Can you please tell me of some easy to use debugger in...
  13. Unable to deallocate memory for a tree structure.

    Hi, I'm trying to deallocate a kd tree which I created dynamically. There were no problems creating the structure and I can access it easily but there is a problem while trying to free
    it. Here's...
  14. Replies
    2
    Views
    1,875

    How is fgets safer ?

    I have seen people saying fgets is safer to use than gets and it avoids buffer overflow. I want to ask how. code :




    int getstring(char *s, size_t n, FILE *fp)
    {
    char *p = NULL;

    ...
  15. Thread: String parsing

    by broli86
    Replies
    3
    Views
    2,665

    One part in this code that's not clear to me is...

    One part in this code that's not clear to me is that you did not check for initial white space. It is possible that there may be some white space before the actual data begins. The rest I think you...
  16. Thread: String parsing

    by broli86
    Replies
    3
    Views
    2,665

    String parsing

    Hi I've a string input and I have to parse it in such a way that that there can be only white space till a digit is reached and once a digit is reached, there can be only digits or white space till...
  17. Replies
    8
    Views
    5,650

    Thanks for that idea. I also have to take care of...

    Thanks for that idea. I also have to take care of division overflow i.e. a/b > DBL_MAX. I'm not sure if loss of precission will be an issue since I'm using double data type.
  18. Replies
    6
    Views
    2,195

    #include #include #include...

    #include <stdio.h>
    #include <stdlib.h>
    #include <errno.h>
    #include <math.h>
    #include <string.h>

    int string_to_double(char *s, char **endptr, double *f)
    {
    int too_big = 0;
  19. Replies
    6
    Views
    2,195

    The endptr pointer (if not passed as NULL) will...

    The endptr pointer (if not passed as NULL) will point to the start of the input string if no conversion was done. If any characters were used, it will be advanced. That's why I checked for :


    ...
  20. Replies
    6
    Views
    2,195

    Ok I changed my code , please have a look : ...

    Ok I changed my code , please have a look :



    int main(void)
    {
    char s[50], *ptr = NULL;
    char *endptr1, *endptr2, *endptr3;
    double f1, f2, f3;
    int too_big = 0;
  21. Replies
    8
    Views
    5,650

    I don't think subt_chk is needed because add_chk...

    I don't think subt_chk is needed because add_chk can take care of it. I have to implement mul_chk and make div_chk more elaborate as to how it should deal with :

    INT_MIN/ -1 , 0/0 inf/0 etc etc
  22. Ok , I appologize.

    Ok , I appologize.
  23. #include int main(void) { int i;...

    #include <stdio.h>

    int main(void)
    {
    int i;
    int j;

    j = 0;
    for (i = 1; i <= 40; i++)
    {
  24. Replies
    6
    Views
    2,195

    Help needed with strtod

    As you can see the first double value in the string i.e. 123.4444e-309 should cause underflow yet i am getting 0.000000 33.4444 -10.555 as the output. The too_small remains 0 . Have I made a mistake...
  25. Replies
    12
    Views
    4,286

    Well I would have used assert, but I don't really...

    Well I would have used assert, but I don't really want to exit on all situations. Only some fatal error situations like memory allocation failure.
Results 1 to 25 of 89
Page 1 of 4 1 2 3 4