473,385 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Error C2065

7
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
May 4 '07 #1
4 3579
svlsr2000
181 Expert 100+
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.
:)
May 4 '07 #2
arunmib
104 100+
i think the following link might be of use to you in the near future...explains about all the compiler errors you get and why get with simple examples....

http://msdn2.microsoft.com/en-us/library/aa249862(VS.60).aspx
May 4 '07 #3
jsl
7
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..
May 4 '07 #4
jsl
7
actually when this deprecations will come..
actually when this deprecations will come...
May 4 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Equilibrium | last post by:
what did I wrong with the program ? (use VC++) /* Using if statment, relational operators, and equality operators */ #include<stdio.h> int main() { printf("Enter two integers, and I will...
4
by: yanyo | last post by:
hi, im trying to figure out whats the problem with this program i get a runtime error but i dont see where the problem is i tried changing declaration but nothing if somrbody can try this on their...
2
by: VicVic | last post by:
Hello, I have an old project, built with VC++. Now need to be compiled in Visual Studio .Net 2003. The project is going to build a DLL. When i try to compile the project, i got the following...
2
by: teddybyte | last post by:
my script below is: #include "stdafx.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, ...
2
by: Nick | last post by:
I'm learning C++ and ran into a compile error using Visual C++ 2005 Express on the following example program (located at http://www.cplusplus.com/doc/tutorial/templates.html): // template...
25
by: notahipee | last post by:
I have been trying to cin an number from 0 to 9 with a leading 0. For example 00 or 07. I was using a switch case. switch (int) { case 01: break; case 02: break;..... My problem arises at 08...
6
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
4
by: VikrantS | last post by:
Hi, I am migrating code from VS 6.0 to VS2008. The Code compiles in VS 6.0 but gives the following errors when compiled in VS 2008, --- \Program Files\VC\atlmfc\include\afxcmn.inl(376) : error...
4
by: backen | last post by:
Hi! i cant get this code to work, I get error c2065, undeclared identifier for some reason donīt really know why... this results in error C2146: syntax error : missing ';' before identifier...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.