Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Explanation of "float" and "ftr[]" in C++

Status
Not open for further replies.

fatma1000

Banned
Full Member level 2
Joined
Apr 30, 2006
Messages
147
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
eygpt
Activity points
0
please explean the mean of
1)
float *x
*x=a*cos(t);

2)
ftr[1]->HY[z+1]=ftr[0]->HY[z+1]-ftr[0]->EX[z+1];

regards

Added after 2 minutes:

sorry explain
not explean
 

Re: help4 c++

1)

float *x

declares a pointer named x

you can make the pointer POINT to a memory location (e.g. a variable of type float) by

float a;
x = &a;

so that *x will give you the value the is stored in 'a', whereas x (without the asterisk) gives you the address to the memory location pointed to by x.





*x=a*cos(t)

stores a*cos(t) - a multiplied by cosine of t
into the memory location pointed to by x






2) ftr[1]->HY[z+1]=ftr[0]->HY[z+1]-ftr[0]->EX[z+1];

ftr is the pointer to a STRUCT. In order to access the members of the structure you have to use the -> operator.

thus, this line subtracts EX[z+1] which is member of ftr[0] from HY[z+1] which is also a member of ftr[0].....and stores the result in HY[z+1] of ftr[1].




YOU NEED TO STUDY POINTERS THOROUGLY....
some nice tutorials and a WONDERFUL C/C++ messageboard can be found at

www.cprogramming.com




--- thanks in advance for clicking HELPED ME :D
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top