For C/C++, you can create a structure to hold a x
and y
value.
typedef struct {
double x;
double y;
} Coordinate;
Inside your main function, you can initialize it like that:
Coordinate treasure = {1.5, 3.2};
To modify a variable’s value:
treasure.x = 3.0;
treasure.y = 4.0;
More Related Contents:
- If condition based look up not working [closed]
- Why are Perl 5’s function prototypes bad?
- How can I require an optional Perl module if installed?
- Specifying file to process to Perl one-liner
- How do I run a Perl script from within a Perl script?
- How do I tell if a variable has a numeric value in Perl?
- Perl flags -pe, -pi, -p, -w, -d, -i, -t?
- What pseudo-operators exist in Perl 5?
- How does double arrow (=>) operator work in Perl?
- Why are Perl source filters bad and when is it OK to use them?
- Perl 5.20 and the fate of smart matching and given-when
- How can I convert the stringified version of array reference to actual array reference in Perl?
- How does Perl parse unquoted bare words?
- How can I interact with ClearCase from Perl?
- Perl build, unit testing, code coverage: A complete working example
- How do I convert a date/time to epoch time (unix time/seconds since 1970) in Perl?
- In Perl, how do I change, delete, or insert a line in a file, or append to the beginning of a file?
- In Perl, how can I find the index of a given value in an array?
- How can I run a system command in Perl asynchronously?
- How can I get a call stack listing in Perl?
- How do I tell what type of value is in a Perl variable?
- What should I use for a Perl script’s shebang line?
- How can I find memory leaks in long-running Perl program?
- What does “select((select(s),$|=1)[0])” do in Perl?
- Why do Perl variables need to start with $, %,@ (sigils)?
- Print lines from one file that are not contained in another file
- Perl DBD::Oracle Module installation
- Why doesn’t print output anything on each iteration of a loop when I use sleep?
- Explain the deviousness of the Perl “preamble”
- Why doesn’t Perl’s each() iterate through the entire hash the second time?