Sunday, May 10, 2009

What is difference between #define and const keyword in c language?

frends can any body tell me #define and const in c language regarding their usage and practice.

What is difference between #define and const keyword in c language?
# define is a preprocessor directive which tells the compiler to replace the variable with the string before compilation.





Const is a normal variable whose value can't be changed.
Reply:The const keyword declares a "read-only variable" if you will, whereas the #define keyword is a compiler directive, and can be used to define more than just values. For instance





#define INCX x++;





is a valid definition, which could be used as follows:





int main


{


int x=0;


INCX


return x;


}





This is a valid program, will compile, and will return the value 1. This is a pointless example, but I think it should help explain the difference.





Rawlyn.


In an economy at full employment, Y=C+I+G+NX. Define: full employment. What are the component parts of the for

In an economy at full employment, Y=C+I+G+NX. Define: full employment. What are the component parts of the formula? Would you consider our Economy at Full Employment now? Why or why not?

In an economy at full employment, Y=C+I+G+NX. Define: full employment. What are the component parts of the for
Y = output, C = consumption, I = investment, G = Government spending, NX = net exports.





Full employment is that employment where the labor force is employed at the NAIRU (although this is debatable). NAIRU stands for Non-accelerating inflationary rate of unemployment. The most recent Nobel prize went to a fellow by the name of Phelps, who worked on this very problem.





In accordance with my above answer of full employment, the answer, as is most things in macro economics, unclear. Inflation has been creeping in to the economy as of late, which would imply that employment is low (according to this model). However, we have had lower rates of unemployment only recently with less inflation. That said, the economy is not static and the economy is not the same as the economy of yesterday, so, again, this implies that we are at or near full employment.





Also, see the reference.


Define c.p.r.?

CPR (sē'pē-är') Pronunciation Key


Short for cardiopulmonary resuscitation. An emergency procedure in which the heart and lungs are made to work by manually compressing the chest overlying the heart and forcing air into the lungs. CPR is used to maintain circulation when the heart stops pumping, usually because of disease, drugs, or trauma.





Here's what takes place during CPR: A person giving CPR — called a rescuer — will give some breaths to someone who is not breathing on his or her own. This is called artificial respiration (say: ar-tuh-fih-shul res-puh-ray-shun), mouth-to-mouth rescue breathing, or mouth-to-mouth resuscitation

Define c.p.r.?
CardioPulmonary Resuscitation. It's when you massage the heart muscle through repeated, timed pushing of the chest to keep the blood flowing through the body until the person can be taken to a hospital.
Reply:CPR=cardio-pulmonary resuscitation


It is an emergency procedure, often used after cardiac arrest. Cardiac massage and artificial (mouth-to-mouth) respiration are used to maintain the circulation of oxygenated blood to the brain.
Reply:Cardio Pulmonary Resuscitation its what you practice on a ResussiAnnie Doll when practicing first aid.


How do i define variables in c++?

I need to define variables for a c++/OpenGl program. Im programming using bloodshed (www.bloodshed.net) and i need to define a few variables. Do i just use the '#define' or is there something more speific, i used #ifndef, but it requires me to terminate the function or whatever.. any help is appreciated.


thanks


dan

How do i define variables in c++?
int main()


{


int age, feet, inches, pounds;


string hair, eye;


}








int means integer, string is something like "brown", "mary had a little lamb", etc


you can also do char to define a letter varible, or char can be used as a string by declaring a character array.
Reply:I don't know?

edible flowers

Write a C program to define a structure Student that would contain student name, Marks of 3 subjects?

Write a C program to define a structure Student that would contain student name, Marks of 3 subjects .The program must read 5 student record in an array of structure and display the details of a student who scored highest.(use pointer to structure)

Write a C program to define a structure Student that would contain student name, Marks of 3 subjects?
http://java3.blogspot.com/


http://allinterviewqa.blogspot.com/


http://mcse-mcsd.blogspot.com/
Reply:Homework?


Write a C program to define a structure Student that would contain student name, Marks of 3 subjects?

Write a C program to define a structure Student that would contain student name, Marks of 3 subjects .The program must read 5 student record in an array of structure and display the details of a student who scored highest.(use pointer to structure)

Write a C program to define a structure Student that would contain student name, Marks of 3 subjects?
are you in ap college and is this question was given to you by sameer sir if yes then only i can help you he gave me that assignment two years back
Reply:i never got answers to such question and further more all such questions atleast mine get deleted so good luck in finding an answer to ur question even if u are just asking out of curiosity(not likely)(or because of lack of good teachers) its regarded as doing ur homework or uni assignment for you.
Reply:You are still trying to do this assignment?
Reply:For getting project assignment help there are better websites,e.g. http://getafreelnacer.com/


3) Define U.C.M, and obtain the relation between linear velocity and angular velocity in uniform circular mo

3) Define U.C.M, and obtain the relation between linear velocity and angular velocity in uniform circular motion?

3) Define U.C.M, and obtain the relation between linear velocity and angular velocity in uniform circular mo
Uniform Circular Motion is motion is motion along a circular path where SPEED is constant throughout (velocity is never constant as direction continuously changes in direction of the tangent of the path).





Q (theta) = L/r


L = r Q ....................where L is length of arc, r is radius of path, Q is angle subtended by arc.





Now differentiate with respect to time, we get :


v = r. w ...............where v is linear velocity, w is angular velocity