CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Paul McKenzie

Search: Search took 0.13 seconds.

  1. Re: error C2440: '=' : cannot convert from 'const char *' to 'char *

    More issues:


    FILE *fp;

    fp=fopen(argv[1],"r");
    You never checked to see if fp is NULL. What if that file doesn't exist?

    Regards,
  2. Re: error C2440: '=' : cannot convert from 'const char *' to 'char *

    Also, your code has a memory leak:


    read_test_off_file=new double[number_of_lines];
    Where is the delete[] for this call to new[]?

    But in general, coding like this in this day and age of C++...
  3. Re: error C2440: '=' : cannot convert from 'const char *' to 'char *

    And what about this erroneous line?


    argv[2]=input_file_name.c_str();
    Did you change that to not modify argv[2]?

    Regards,

    Paul McKenzie
  4. Re: error C2440: '=' : cannot convert from 'const char *' to 'char *

    First, use code tags when posting code. The code you posted is practically unreadable.

    Second, you should not be attempting to change argv[] directly. Just copy the values of argv[] to your own...
Results 1 to 4 of 4





Click Here to Expand Forum to Full Width

Featured