470,848 Members | 2,530 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Could anyone explain me which are not permitted?

1
Here is a list of function declarations, some variables and assignments. Which of them
are not permitted and why?

Expand|Select|Wrap|Line Numbers
  1. int foo ( const int &) {
  2.   return 0;
  3. }
  4.  
  5. int bar ( int &) {
  6.   return 0;
  7. }
  8.  
  9. int main () {
  10.   int i = 0;
  11.   int & j = i ;
  12.   static const int f = i ;
  13.   int * const p = 0;
  14.   p = & i ;
  15.   * p = f ;
  16.   const int & l = j ;
  17.   const int & k = f ;
  18.   foo ( j );
  19.   bar ( l );
  20.   foo ( k );
  21. }
Jun 5 '21 #1
1 2485
dev7060
575 Expert 512MB
Here is a list of function declarations, some variables and assignments. Which of them
are not permitted and why?
Use a compiler.       
Jun 6 '21 #2

Post your reply

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

Similar topics

3 posts views Thread by Ranyart Olias | last post: by
4 posts views Thread by Chris | last post: by
13 posts views Thread by C++fan | last post: by
21 posts views Thread by Gactimus | last post: by
3 posts views Thread by wesley.hall | last post: by
1 post views Thread by Andrew | last post: by
5 posts views Thread by tony | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.