+ 2
How can we directly save users input at some memory address in c++?
If user enter a value we usually save it using some variable and also access it using that variable. eg. int a; // declaration cin>>a;. // assigning value cout>>a; // accessing value here this variable a has some memory address and we can also access it using pointer.. but what if we don't like to create so much of variable in a program? I would like to save users input directly to a memory address..and not to any variable..! please explain me in detail how to do it?
4 Respostas
+ 2
Borislav Kalinski couldyou give me an example
+ 1
A variable its the content of a memory adress, then .....
+ 1
Do you know assembler? In C++ you can use assembler code using _asm { put here assembler code}. In assembler you can access directly CPU registers. Every variable you create is saved in this registers.
- 1
You need a variable to access the content of a memory location.