I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
Pointer is a special type of variable that is used to store the memory address of another variable of free memory requested by the programmer or user during the execution of the program. To understand dynamic data structures understanding pointer is definitely must. In simple words pointer is a variable that stores memory address whereas simple variables store data.
For example, when variable is declared the memory is allocated to that variable by the compiler during the compilation of the program. Once memory is allocated the data can be stored in that memory location. The data is referred by the name of the variable. If the address of that variable is to be stored then the pointer variable is necessary. Consider the declaration statement of “C” language: int age;
Assuming that during compilation memory address allocated variable age is 1000, and the address 1000 is to be stored in another variable that variable should be of the type pointer.
In case of ‘C’ language the pointer variables are simply declared by means of prefixing an asterisk (*) to the variable name in a normal declaration statement. For example, int *page; declares a pointer variable page of the type int. Now page can be used to store the address of a simple integer variable. i.e. page = &age.
When a pointer variable is declared, the memory is not allocated to such variable during the compilation. So it can point to any already allocated address of variable or an address of requested free memory. The type of free memory or variable should match with the type of pointer variable. Pointer variables are advantageous when they are used for dynamic memory allocation and function call by reference.
For example, when variable is declared the memory is allocated to that variable by the compiler during the compilation of the program. Once memory is allocated the data can be stored in that memory location. The data is referred by the name of the variable. If the address of that variable is to be stored then the pointer variable is necessary. Consider the declaration statement of “C” language: int age;
Assuming that during compilation memory address allocated variable age is 1000, and the address 1000 is to be stored in another variable that variable should be of the type pointer.
In case of ‘C’ language the pointer variables are simply declared by means of prefixing an asterisk (*) to the variable name in a normal declaration statement. For example, int *page; declares a pointer variable page of the type int. Now page can be used to store the address of a simple integer variable. i.e. page = &age.
When a pointer variable is declared, the memory is not allocated to such variable during the compilation. So it can point to any already allocated address of variable or an address of requested free memory. The type of free memory or variable should match with the type of pointer variable. Pointer variables are advantageous when they are used for dynamic memory allocation and function call by reference.
Comments
Post a Comment