Solved

Location of variables declaration

Posted on 2004-08-06
2
202 Views
Last Modified: 2010-04-01
I facing a very funny problem in VC++ ..  I am not being able to declare variables whereever i like. Like in C, it insists that i declare variables in the beginning of the function..cud anyone guess the reason ??
0
Comment
Question by:shubha_mohan
2 Comments
 
LVL 15

Accepted Solution

by:
efn earned 50 total points
ID: 11737059
If the name of the file ends in ".c", it will compile it as C.  That's all I can think of.  Maybe if you show a sample and the error message, someone may be able to help more.
0
 

Author Comment

by:shubha_mohan
ID: 11737111
I did think of that and the files are C++. And there are no specific error messages..Just that those variables appear undefined yet.. Thanks anyway !!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now