Hi bsuribabu,
I think you mixed C++ and C. In C there is nothing like a reference. Your "assumptions" seem right for C++. Note: you can think of an reference as if it where a shorthand for a pointer variable, because this is the way it is implemented. If you call a function with a...
Sorry, had an mistace in may last post, here is correct verison:
#include <stdio.h>
#define DATA_FILE "rates.txt"
void get_data(double array[][5]);
void present(double a2d[][5]);
void populate(double a2d[][5]);
int main(int argc, char *argv[])
{
double array[5][5]...
Hello,
first you sould declare main to return an int value and to accept two parameters, as the line below shows:
int main(int argc, char *argv[])
Then you should lay back and think about the problem you have.
First you need a 2d array 5*5:
double array[5][5];
Then you can define a...
Hi lionlhill
youp, you are right, but we must not forget that not all compilers have equally well designed optimization techniques buildin. With those compilers you are happy to give him some hints. This is espassially true for C, because C is not a pretty languge, but it gives you control over...
Hi bsuribabu,
all automatic variables (that is what non static local variables are) go to stack, as well as the PC :-) and (depending on the architecutre and compiler) some function parameters.
Dynamic variables, which are not automatic, have to be allocated by the programmer :-). This is...
Hi bsuribabu,
microcrontrollers have a special region of memory (special addresses), into which some registers are mapped. This means, if you access this address with a move instruction, you do not access RAM (or ROM), but you in fact access an register of the CPU. Thus you can not have useful...
Hello lionelhill,
the modifier register is only an hint for the compiler to try to keep a variables content in an register during its liftime. Which registers are used for variable values depends highly on architecture and even compiler. E.g. a compilers vendor could use only two register to...
Hi PieterWinter,
thank you for your clarification. Now I fully agree with you.
I misinterpreted your description. For me the content (or value) of an address register is the address it points to, but this might be wrong due to a lack of my experience in english. What is the right terminology...
Hello,
I want to access a physical memory address in my Tcl/Tk script. Does anyone know how this could be done with Tcl?
At the moment I can only think of an DLL writte in VC doing the access for Tcl.
Oh, the script should run on Windows 95/NT/2000 and XP
Thanks
Volatile does not neccesarily mean that the value of a varialbes changes. It only instructs the compiler to not optimize the code using the variable. So the compiler can not optimize by keeping its value in a register. The compiler generates code which always store the variable in memory if a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.