Error C2065

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jsl
    New Member
    • May 2007
    • 7

    Error C2065

    i have converted my project from vc++ 6.0 to visual studio 2005, then the following code is giving me a problem
    sample()
    {
    //int i; -------------(1)
    for(int i=0; i<5;i++)-------------(2)
    {
    ......
    .....
    }

    i=20;----------(3)
    }

    The error i got at (3) is Error C2065: 'i' : undeclared identifier. If i remove the declaration of i at (2) and declared at (1), iam getting lot of warnings like warning C4996: 'fopen' was declared deprecated... how can i declare
  • svlsr2000
    Recognized Expert New Member
    • Feb 2007
    • 181

    #2
    Originally posted by jsl
    i have converted my project from vc++ 6.0 to visual studio 2005, then the following code is giving me a problem
    sample()
    {
    //int i; -------------(1)
    for(int i=0; i<5;i++)-------------(2)
    {
    ......
    .....
    }

    i=20;----------(3)
    }

    The error i got at (3) is Error C2065: 'i' : undeclared identifier. If i remove the declaration of i at (2) and declared at (1), iam getting lot of warnings like warning C4996: 'fopen' was declared deprecated... how can i declare
    The scope of i in your statement 2 is only inside for loop. You need to declare i according to 1.

    Fopen is deprecated since we have much more secure version available. fopen_s. Since fopen_s is much more secure then fopen.

    If you are confident enough about the security you can supress the warning.
    :)

    Comment

    • arunmib
      New Member
      • May 2007
      • 104

      #3
      i think the following link might be of use to you in the near future...explai ns about all the compiler errors you get and why get with simple examples....

      http://msdn2.microsoft .com/en-us/library/aa249862(VS.60) .aspx

      Comment

      • jsl
        New Member
        • May 2007
        • 7

        #4
        Originally posted by svlsr2000
        The scope of i in your statement 2 is only inside for loop. You need to declare i according to 1.

        Fopen is deprecated since we have much more secure version available. fopen_s. Since fopen_s is much more secure then fopen.

        If you are confident enough about the security you can supress the warning.
        :)

        actually whwn this decations will come..

        Comment

        • jsl
          New Member
          • May 2007
          • 7

          #5
          Originally posted by jsl
          actually when this deprecations will come..
          actually when this deprecations will come...

          Comment

          Working...