ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  VC++  >>  VC++ AllOther
 
 


 

 
 MFC interview questions  MFC Interview Questions
 ATL interview questions  ATL Interview Questions
 COM DCOM interview questions  COM DCOM Interview Questions
 Win32API interview questions  Win32API Interview Questions
 ActiveX interview questions  ActiveX Interview Questions
 VC++ AllOther interview questions  VC++ AllOther Interview Questions
Question
A file a.cpp & B.cpp are complied & linked together in VC++
file a is something like int a =100;, File B is something 
like extern a;
main()
{
printf("%d",a);
}what will be the output.a)100,b)linker error,c)complier 
error etc etc.
 Question Submitted By :: Archana
I also faced this Question!!     Rank Answer Posted By  
 
  Re: A file a.cpp & B.cpp are complied & linked together in VC++ file a is something like int a =100;, File B is something like extern a; main() { printf("%d",a); }what will be the output.a)100,b)linker error,c)complier error etc etc.
Answer
# 1
Compiler error
 
Is This Answer Correct ?    0 Yes 2 No
Zerozero
 
  Re: A file a.cpp & B.cpp are complied & linked together in VC++ file a is something like int a =100;, File B is something like extern a; main() { printf("%d",a); }what will be the output.a)100,b)linker error,c)complier error etc etc.
Answer
# 2
It should be compiler 1 compiler error and 1 warning
Error : Undeclared identifier
we have to include stdio.h
Warning: main should return a value; but it assume as return
type as void.
 
Is This Answer Correct ?    1 Yes 0 No
Ashish Chandrakar
 
 
 
  Re: A file a.cpp & B.cpp are complied & linked together in VC++ file a is something like int a =100;, File B is something like extern a; main() { printf("%d",a); }what will be the output.a)100,b)linker error,c)complier error etc etc.
Answer
# 3
Take an example, if you are working on a C++ project but it
also deals with some existing C functions/libraries.
You want to wrap them in a C++ module or compile them with
other C++ objects without any C++ compiler errors, then you
would declare the C function prototypes in an extern "C"
block to notify the compiler that they would be compiled
along with other C++ functions into one module.

For example:

my_C_CPP_Header.h:

#ifndef MY_C_CPP_HEADER
#define MY_C_CPP_HEADER


/*check if the compiler is of C++*/
#ifdef __cplusplus
extern "C" {
int myOtherCfunc(int arg1, int arg2); /* a C function */
}
#endif

void myCppFunction1(); /* C++ function */
void myCppFunction2(); /* C++ function */

/*check if the compiler is of C++ */
#ifdef __cplusplus
}
#endif

#endif


Now all three functions are comiled into one module by C++
compiler.

So the out put is (a)100.
 
Is This Answer Correct ?    2 Yes 0 No
Shankar
 

 
 
 
Other VC++ AllOther Interview Questions
 
  Question Asked @ Answers
 
How a dll will be sharable by more than one exe? CA4
how i can design a user interface in vc++ for getting inputs from users Path-Finders1
What is a glyph?  2
TO start the build process in Developer Studio Which keyboard function is used ?  3
What is the difference between Undo and Redo?  2
Which steps are required to add a column to a list view?  1
Name the most commonly used wizards?  1
what is mean [] inc what is the use of include conio.h in c  1
What is the difference between serialization and deserialization? MBT2
What is the RGB macro used for?  1
What is the difference between the client and non-client areas?  2
What keyboard editor command is used for Undo?  1
How to declare more than one variable on a single line? CMC3
How can i communicate with two systems one is located some place another is located 100km how from the current systems which protocala i have to use Invensys1
What is type-safety?  1
What is the file extension used for C++ class implementation files?  3
What Is Your Greatest Weakness? Servion2
Name some examples of the different types of windows found in a Windows application?  4
How do you define a function in vc++?  1
What is the purpose of a C++ namespace?  2
 
For more VC++ AllOther Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com