check out cplusplus.com, it's an amazing resource...
morning glory
Tuesday, July 14, 2009
Would side bangs look good on me? pi c included...?
im getting my hair cut tomorrow....i was think layers and side swept bangs...what do you guys think?
mee
http://i200.photobucket.com/albums/aa130...
http://i200.photobucket.com/albums/aa130...
http://i200.photobucket.com/albums/aa130...
Would side bangs look good on me? pi c included...?
Hey yur pics dont work, but anywayy side bangs R always cute, juss dont make them too short
Happy Cutting !
Reply:yea they would lyk nice!
Reply:last year I have a bangs from now I have parin!! I'm so sad to have a bangs don't do it 2 yourself please....
U will be sad and angry 2 if U will cut Ur beauty cutie hair!!
from 11 yrs.old child,
Ynah
Reply:The pic won't load, so idk what to tell you.....
Do some research on what face shapes are side bangs best suited for, but I think they fit mostly anyone. I have them, they're really cute =D
Although they bothered me at first, b/c they kept going into my eyes haha.
Reply:your links worked for me and i deffinitly think side bangs would look good. i like them on mostly anyone but in your case i think it would be a nice change. i wouldnt go to short at first. your sytlist can always go back and adjust the length when she is finished.
mee
http://i200.photobucket.com/albums/aa130...
http://i200.photobucket.com/albums/aa130...
http://i200.photobucket.com/albums/aa130...
Would side bangs look good on me? pi c included...?
Hey yur pics dont work, but anywayy side bangs R always cute, juss dont make them too short
Happy Cutting !
Reply:yea they would lyk nice!
Reply:last year I have a bangs from now I have parin!! I'm so sad to have a bangs don't do it 2 yourself please....
U will be sad and angry 2 if U will cut Ur beauty cutie hair!!
from 11 yrs.old child,
Ynah
Reply:The pic won't load, so idk what to tell you.....
Do some research on what face shapes are side bangs best suited for, but I think they fit mostly anyone. I have them, they're really cute =D
Although they bothered me at first, b/c they kept going into my eyes haha.
Reply:your links worked for me and i deffinitly think side bangs would look good. i like them on mostly anyone but in your case i think it would be a nice change. i wouldnt go to short at first. your sytlist can always go back and adjust the length when she is finished.
What dangerous animal starts with the letter c, includes the letter o and ends with t?
a cobalt-spider-they are venomous and are relatively big
What dangerous animal starts with the letter c, includes the letter o and ends with t?
"Catamount".
Reply:red coated gurilla
Reply:cormorant ?
What dangerous animal starts with the letter c, includes the letter o and ends with t?
"Catamount".
Reply:red coated gurilla
Reply:cormorant ?
Where can I find info on C++, including info on how to use a compiler? I am a COMPLETE novice, I need BASICS!
I know nothing about anything having to do with computer programming. Online would be most helpful, but even books. Thanks.
Where can I find info on C++, including info on how to use a compiler? I am a COMPLETE novice, I need BASICS!
I'd recommend searching Yahoo or Google for C++ projects or tutorials. As for books there is a book called Learn C++ in 21 days, it goes over different things and gives you a project to do every day for 3 weeks. I really enjoyed it. The links below take you to some stuff I've found helful. I'm pretty sure a manual comes with the compiler download however I'm not on my PC right now so I'm unable to tell. Hope this info helps.
Bloodshed Software
Compiler Download: http://www.bloodshed.net/devcpp.html
Tutorial: http://www.silicontao.com/ProgrammingGui...
Reply:first dont worry about learning c++, you need to learn to programme, find a book on UML, that will help (Very boring) then get any programming books you can find in java or C++ and learn from there.
here is a cool like to help you start of.
http://www.fredosaurus.com/notes-cpp/ind...
Reply:There are a lot of resources online to learn about computer languages and how to use a compiler , you can search online for a free complier and free info on the complier.
If you are running windows 2000,xp or vista Microsoft has a really good free complier called Express edition you can legally download the software and use it for free the visual studio express has C++ C# java and Visual basic.
I have a few links for you to look at.
Good luck and have a lot of fun!!
Where can I find info on C++, including info on how to use a compiler? I am a COMPLETE novice, I need BASICS!
I'd recommend searching Yahoo or Google for C++ projects or tutorials. As for books there is a book called Learn C++ in 21 days, it goes over different things and gives you a project to do every day for 3 weeks. I really enjoyed it. The links below take you to some stuff I've found helful. I'm pretty sure a manual comes with the compiler download however I'm not on my PC right now so I'm unable to tell. Hope this info helps.
Bloodshed Software
Compiler Download: http://www.bloodshed.net/devcpp.html
Tutorial: http://www.silicontao.com/ProgrammingGui...
Reply:first dont worry about learning c++, you need to learn to programme, find a book on UML, that will help (Very boring) then get any programming books you can find in java or C++ and learn from there.
here is a cool like to help you start of.
http://www.fredosaurus.com/notes-cpp/ind...
Reply:There are a lot of resources online to learn about computer languages and how to use a compiler , you can search online for a free complier and free info on the complier.
If you are running windows 2000,xp or vista Microsoft has a really good free complier called Express edition you can legally download the software and use it for free the visual studio express has C++ C# java and Visual basic.
I have a few links for you to look at.
Good luck and have a lot of fun!!
Bloodshed Dev C++ compiler error?
I keep having the same error, even on diferent systems and different codes!??
--------------------------------------...
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
make.exe: Circular man %26lt;- man.o dependency dropped.
g++.exe -c man -o man.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/incl... -I"C:/Dev-Cpp/include/c++/3.4.2/backward... -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
g++.exe: man: linker input file unused because linking not done
g++.exe man.o -o "Project1.exe" -L"C:/Dev-Cpp/lib"
g++.exe: man.o: No such file or directory
g++.exe: no input files
make.exe: *** [Project1.exe] Error 1
Execution terminated
--------------------------------------...
Bloodshed Dev C++ compiler error?
Well that error has to deal with linking, so check your functions and classes and make sure you are passing the correct amount of parameters in the function prototype,definition,and calls.
Also, make sure you have write access to where your tring to complie the program...I had this happen to me once, took me forever to figure out.
Also, I really doubt it, but check your pre-processor directives, make sure you include the nessary ones.
geranium
--------------------------------------...
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
make.exe: Circular man %26lt;- man.o dependency dropped.
g++.exe -c man -o man.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/incl... -I"C:/Dev-Cpp/include/c++/3.4.2/backward... -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
g++.exe: man: linker input file unused because linking not done
g++.exe man.o -o "Project1.exe" -L"C:/Dev-Cpp/lib"
g++.exe: man.o: No such file or directory
g++.exe: no input files
make.exe: *** [Project1.exe] Error 1
Execution terminated
--------------------------------------...
Bloodshed Dev C++ compiler error?
Well that error has to deal with linking, so check your functions and classes and make sure you are passing the correct amount of parameters in the function prototype,definition,and calls.
Also, make sure you have write access to where your tring to complie the program...I had this happen to me once, took me forever to figure out.
Also, I really doubt it, but check your pre-processor directives, make sure you include the nessary ones.
geranium
How can I find out if my Mac OS X computer has a C++ compiler already included?
I was told that Macs already come with a C++ compiler included, however, I'm not so sure how and where to look for it. Can anybody tell me how to find it? My Mac is version 10.4.7
How can I find out if my Mac OS X computer has a C++ compiler already included?
Your Mac probably does not come with the compiler installed, though it should come with an XCode installer on the CD/DVD, which will give you a compiler (GCC). In the event your system does already have the (GCC) compiler installed, you can verify such by going to Terminal and typing 'cc', 'gcc' or 'g++'. If any of these binaries already exist, the system should find one somewhere among your path.
Hoping everything works out as it should.
How can I find out if my Mac OS X computer has a C++ compiler already included?
Your Mac probably does not come with the compiler installed, though it should come with an XCode installer on the CD/DVD, which will give you a compiler (GCC). In the event your system does already have the (GCC) compiler installed, you can verify such by going to Terminal and typing 'cc', 'gcc' or 'g++'. If any of these binaries already exist, the system should find one somewhere among your path.
Hoping everything works out as it should.
Fill in the blanks... 5 D in a Z C = 5 digits in a zip code?
81.6 W of H the E
82.56 S of the D of I
83.20 Y that R V W S
84.40 T (with A B)
85.10 A in the B of R
86.435 M of the H of R
87.2 T D (and a P in a P T)
88.8 P of S in the E L
89.4 S on a V
90.5 T on a C (including S in T)
Fill in the blanks... 5 D in a Z C = 5 digits in a zip code?
What blanks?
Reply:What blanks?
Another 2 points ;-b
82.56 S of the D of I
83.20 Y that R V W S
84.40 T (with A B)
85.10 A in the B of R
86.435 M of the H of R
87.2 T D (and a P in a P T)
88.8 P of S in the E L
89.4 S on a V
90.5 T on a C (including S in T)
Fill in the blanks... 5 D in a Z C = 5 digits in a zip code?
What blanks?
Reply:What blanks?
Another 2 points ;-b
The usa have 50 states. each send 2 senators into senate. doesn´ d.c. have senators or representates?
i live in germany so i m not so familiar with us-pilotics. so if each state send 2 senators into senate, and some representatives into the house of representatives, who are this making the people living in washington d.c.? do they have senators to elect?
and is washington d.c. a state (like illinois), or not? do you have 50 states or 51 (with d.c.) included? or do you have 50 states plus washington d.c., as a "special state"?
thanks
The usa have 50 states. each send 2 senators into senate. doesn´ d.c. have senators or representates?
No Washington D.C. does not get any representatives or senators however the Twenty-third ammendment, which was ratified in 1951, states that;
"The District constituting the seat of Government of the United States shall appoint in such manner as the Congress may direct:
A number of electors of President and Vice President equal to the whole number of Senators and Representatives in Congress to which the District would be entitled if it were a State, but in no event more than the least populous State; they shall be in addition to those appointed by the States, but they shall be considered, for the purposes of the election of President and Vice President, to be electors appointed by a State..."
To sum this up in mordern lingo; the District of Columbia does not get any representatives or senators, but for the purposes of electing a president it gets however many votes in the electoral college as it would if it were a state. But it's number of votes cannot exceed the number any state gets, so even if its population is big enough for six votes, if one of the states only has three, then D.C. can't have more than any of the states so it only get three.
But that's only for electing the President and Vice President.
(By the way I'm pretty sure that the actual amount of electoral votes that D.C. gets is three.)
Reply:50 states, correct. but washington DC is not a state. so no representatives/senators for DC.
note: that is where congress, the president and senators reunite also.
Reply:D.C. is not (nor does it deserve to be) a state. And if you had a good look at the leftist losers who mostly inhabit D.C., you'd have to agree that it's a good think they don't have representation on the national level.
Reply:D.C. is not a state so has no sens.
They did however have a crack smoking democrat for a mayor.
Not once but twice.
Party of the jackass.
Reply:The District of Columbia and US possessions, such as Puerto Rico, American Samoa, Northern Marianas and such do have Representatives, but I don't believe that any of them have a vote. They are able to let their wishes be known through which ever group they caucus with.
The poster who made the remark about Mayor Barry will be gratified to know that Marion Barry is No longer the Mayor. Mayor Williams was recently replaced by Mayor Fenty. Fenty seems to actually be doing a good job as Mayor. He is a fairly young guy and except for his desire to outlaw the 2nd Amendment of the Constitution, he seems to have his head screwed on right. The Supreme Court overturned the District's anti-gun law, so now the citizens can defend themselves.
Reply:No. DC is not a state so they cannot elect representatives to the government. They can't own guns either. It's almost a foreign country in the USA. Lots and lots of crime too. Most of us stay away from there.
Reply:Fifty states, and the District of Columbia which is not a state. DC has a representative and senators, but they are "shadows" and cannot vote in Congress.
Reply:No, they don't. Washington, D.C. is not a state. The DC stands for District of Columbia. We have only 50 states.
Reply:Washington, DC, is technically a city. The District of Columbia is just a region. While it is commonly given its own contestant in Miss America pageants, it does not have representation in the Senate. It does however, have a non-voting member in the House of Representatives. This person is allowed to sit in on sessions and participate in debates, but has no power to vote in decisions. The Congress of the United States is given the jurisdiction over Washington, DC.
There have been attempts in the past to change the representation of Washington, DC, which include statehood, these, however, have been unsuccessful.
Reply:Because it is not a state.
and is washington d.c. a state (like illinois), or not? do you have 50 states or 51 (with d.c.) included? or do you have 50 states plus washington d.c., as a "special state"?
thanks
The usa have 50 states. each send 2 senators into senate. doesn´ d.c. have senators or representates?
No Washington D.C. does not get any representatives or senators however the Twenty-third ammendment, which was ratified in 1951, states that;
"The District constituting the seat of Government of the United States shall appoint in such manner as the Congress may direct:
A number of electors of President and Vice President equal to the whole number of Senators and Representatives in Congress to which the District would be entitled if it were a State, but in no event more than the least populous State; they shall be in addition to those appointed by the States, but they shall be considered, for the purposes of the election of President and Vice President, to be electors appointed by a State..."
To sum this up in mordern lingo; the District of Columbia does not get any representatives or senators, but for the purposes of electing a president it gets however many votes in the electoral college as it would if it were a state. But it's number of votes cannot exceed the number any state gets, so even if its population is big enough for six votes, if one of the states only has three, then D.C. can't have more than any of the states so it only get three.
But that's only for electing the President and Vice President.
(By the way I'm pretty sure that the actual amount of electoral votes that D.C. gets is three.)
Reply:50 states, correct. but washington DC is not a state. so no representatives/senators for DC.
note: that is where congress, the president and senators reunite also.
Reply:D.C. is not (nor does it deserve to be) a state. And if you had a good look at the leftist losers who mostly inhabit D.C., you'd have to agree that it's a good think they don't have representation on the national level.
Reply:D.C. is not a state so has no sens.
They did however have a crack smoking democrat for a mayor.
Not once but twice.
Party of the jackass.
Reply:The District of Columbia and US possessions, such as Puerto Rico, American Samoa, Northern Marianas and such do have Representatives, but I don't believe that any of them have a vote. They are able to let their wishes be known through which ever group they caucus with.
The poster who made the remark about Mayor Barry will be gratified to know that Marion Barry is No longer the Mayor. Mayor Williams was recently replaced by Mayor Fenty. Fenty seems to actually be doing a good job as Mayor. He is a fairly young guy and except for his desire to outlaw the 2nd Amendment of the Constitution, he seems to have his head screwed on right. The Supreme Court overturned the District's anti-gun law, so now the citizens can defend themselves.
Reply:No. DC is not a state so they cannot elect representatives to the government. They can't own guns either. It's almost a foreign country in the USA. Lots and lots of crime too. Most of us stay away from there.
Reply:Fifty states, and the District of Columbia which is not a state. DC has a representative and senators, but they are "shadows" and cannot vote in Congress.
Reply:No, they don't. Washington, D.C. is not a state. The DC stands for District of Columbia. We have only 50 states.
Reply:Washington, DC, is technically a city. The District of Columbia is just a region. While it is commonly given its own contestant in Miss America pageants, it does not have representation in the Senate. It does however, have a non-voting member in the House of Representatives. This person is allowed to sit in on sessions and participate in debates, but has no power to vote in decisions. The Congress of the United States is given the jurisdiction over Washington, DC.
There have been attempts in the past to change the representation of Washington, DC, which include statehood, these, however, have been unsuccessful.
Reply:Because it is not a state.
Things with Vitamin-C?
Does anyone know of any good recipes or vitamins that will boost my Vitamin-C including drinks.
Things with Vitamin-C?
oranges
or most squash drinks or fruit juices
grapefruits
Reply:Any of the citrus fruits are a good source of vitamin C so is V8 juice or tomatos. Try making smoothies with the citrus fruits.
Reply:Fruits, vegetables, and juices. You can also take vitamins to get extra Vitamin-C, or take pills. Just don't take overdoses of it. Follow this/these link(s) for healthy Vitamin-C recipes!
Hope this helps!!
take care!!
http://www.pccnaturalmarkets.com/health/...
http://www.epicurious.com/recipes/menus/...
Reply:Lemon is good. I have it once a day in the morning. squeeze out the juice and drink it with/without little salt. I do not like lemon drink cos it taste sour. fresh squeeze lemon juice is excellance.
Cherry drinks by AMWAY. Easy to prepare and taste good.
Reply:Most citrus fruits are a good source of Vitamin C but one of the best fruits is kiwi fruit. There are many lovely recipes with kiwi fruit in them or eat them by themselves. Also blackcurrant is a good source of vitamin C.
A great recipe if your feeling low and/or have a sore throat is blackcurrant and starwberry icy poles.
1 cup blackcurrants
1 cup strawberries
4 tbspn fructose
1 cup apple juice.
Blend together in blender, sieve to remove seeds and pour into moulds and freeze until set.
sweet pea
Things with Vitamin-C?
oranges
or most squash drinks or fruit juices
grapefruits
Reply:Any of the citrus fruits are a good source of vitamin C so is V8 juice or tomatos. Try making smoothies with the citrus fruits.
Reply:Fruits, vegetables, and juices. You can also take vitamins to get extra Vitamin-C, or take pills. Just don't take overdoses of it. Follow this/these link(s) for healthy Vitamin-C recipes!
Hope this helps!!
take care!!
http://www.pccnaturalmarkets.com/health/...
http://www.epicurious.com/recipes/menus/...
Reply:Lemon is good. I have it once a day in the morning. squeeze out the juice and drink it with/without little salt. I do not like lemon drink cos it taste sour. fresh squeeze lemon juice is excellance.
Cherry drinks by AMWAY. Easy to prepare and taste good.
Reply:Most citrus fruits are a good source of Vitamin C but one of the best fruits is kiwi fruit. There are many lovely recipes with kiwi fruit in them or eat them by themselves. Also blackcurrant is a good source of vitamin C.
A great recipe if your feeling low and/or have a sore throat is blackcurrant and starwberry icy poles.
1 cup blackcurrants
1 cup strawberries
4 tbspn fructose
1 cup apple juice.
Blend together in blender, sieve to remove seeds and pour into moulds and freeze until set.
sweet pea
1996 Ford Windstar A/C issues. Cold in the front hot in the back.?
I have a 1996 Ford Windstar with 2 problems with the A/C(dual system). When you turn the A/C on it blows cold as ice in the front and really hot in the back and then after a couple of minutes the A/C including blower shuts off and on constantly. What the heck is going on? Someone Please help?
1996 Ford Windstar A/C issues. Cold in the front hot in the back.?
I used to have a 1998 Windstar that blew hot air in the back when I had the a/c on. My husband mentioned it to our mechanic and he said he couldn't check it unless it was doing it at the time and I guess it wasn't. The only thing that worked for me was to turn the rear air on while the motor was off. Then it usually blew the cold air. If I turned the control off and tried to turn it on while the motor was running, it would blow hot. If you can get it to blow cold at all then leave the controls alone and don't change them. The times mine would blow hot, I just had to turn the rear air off and forget about it. It's a pain but things could be worse.
Reply:there could be a number of things going on. you don't want to guess at issues like this, go pay the fee to get a diagnostic done and you can go from there
1996 Ford Windstar A/C issues. Cold in the front hot in the back.?
I used to have a 1998 Windstar that blew hot air in the back when I had the a/c on. My husband mentioned it to our mechanic and he said he couldn't check it unless it was doing it at the time and I guess it wasn't. The only thing that worked for me was to turn the rear air on while the motor was off. Then it usually blew the cold air. If I turned the control off and tried to turn it on while the motor was running, it would blow hot. If you can get it to blow cold at all then leave the controls alone and don't change them. The times mine would blow hot, I just had to turn the rear air off and forget about it. It's a pain but things could be worse.
Reply:there could be a number of things going on. you don't want to guess at issues like this, go pay the fee to get a diagnostic done and you can go from there
1996 Ford Windstar A/C issues. Cold in the front hot in the back.?
I have a 1996 Ford Windstar with 2 problems with the A/C(dual system). When you turn the A/C on it blows cold as ice in the front and really hot in the back and then after a couple of minutes the A/C including blower shuts off and on constantly. What the heck is going on? Someone Please help?
1996 Ford Windstar A/C issues. Cold in the front hot in the back.?
The system is cycling because you may not be getting enough air through the condenser as the baffle controlling the air to the back is not opening. You need to verify this or have a mechanic check.
1996 Ford Windstar A/C issues. Cold in the front hot in the back.?
The system is cycling because you may not be getting enough air through the condenser as the baffle controlling the air to the back is not opening. You need to verify this or have a mechanic check.
If you were to put together a c.d. entitled "The Best of '80's Punk", what songs would you include?
Hard to say; most good punk -- including a lot of the songs mentioned in some of the above answers -- was actually from the mid-to-late 1970s. The best of it -- The Ramones, the Buzzcocks, the Damned, the Sex Pistols, the Clash -=- was already on the way out when the Age Of Reagan began and New Wave started taking over. (More that a little of what was mentioned above is really New Wave, not punk.)
BUT -- I checked, and the Ramones' "Rock and Roll High School" was released in 1980, and "Subterranean Jungle" in 1983, so I'll go with those.
If you were to put together a c.d. entitled "The Best of '80's Punk", what songs would you include?
Ghetto Defendant - The Clash
London Calling- The Clash
Reply:The Misfits - Die, Die, Die My Darling, Astro Zombies
Black Flag - TV Party
The Ramones - My Brain is Hanging Upside Down (Bonzo Goes to Bitburg), Mama's Boy, The KKK Took My Baby Away
Siouxie %26amp; the Banshees -Peek-a-boo
Bad Brains - I against I, Pay to C*m, Banned in DC
Dead Kennedys - Kill The Poor, California Uber Allies, Holiday In Cambodia, Too Drunk To F**k
Reply:"Rock the Casbah" by The Clash
"Don't Stand So Close to Me" by The Police
"Blitzkrieg Bop" by The Ramones
"The Metro" by Berlin
"Love on your side" by the Thompson Twins
"Why Me" by Planet P
"Sunday Bloody Sunday" by U2
"Zombie" by The Cranberries
Reply:Cindy Lauper, Pat Benatar ohhh brain freeze, can't think anymore.
Reply:tsol, code red,d.i. richard hung himself, exploited barmy army,day glo abortions proud to be a canadian
Reply:The Ramones - I Wanna Be Sedated
Sex Pistols - Anarchy
Ian Drury - Sex and Drugs and Rock and Roll
The Clash - London Calling
Reply:bad brains.. i against i
BUT -- I checked, and the Ramones' "Rock and Roll High School" was released in 1980, and "Subterranean Jungle" in 1983, so I'll go with those.
If you were to put together a c.d. entitled "The Best of '80's Punk", what songs would you include?
Ghetto Defendant - The Clash
London Calling- The Clash
Reply:The Misfits - Die, Die, Die My Darling, Astro Zombies
Black Flag - TV Party
The Ramones - My Brain is Hanging Upside Down (Bonzo Goes to Bitburg), Mama's Boy, The KKK Took My Baby Away
Siouxie %26amp; the Banshees -Peek-a-boo
Bad Brains - I against I, Pay to C*m, Banned in DC
Dead Kennedys - Kill The Poor, California Uber Allies, Holiday In Cambodia, Too Drunk To F**k
Reply:"Rock the Casbah" by The Clash
"Don't Stand So Close to Me" by The Police
"Blitzkrieg Bop" by The Ramones
"The Metro" by Berlin
"Love on your side" by the Thompson Twins
"Why Me" by Planet P
"Sunday Bloody Sunday" by U2
"Zombie" by The Cranberries
Reply:Cindy Lauper, Pat Benatar ohhh brain freeze, can't think anymore.
Reply:tsol, code red,d.i. richard hung himself, exploited barmy army,day glo abortions proud to be a canadian
Reply:The Ramones - I Wanna Be Sedated
Sex Pistols - Anarchy
Ian Drury - Sex and Drugs and Rock and Roll
The Clash - London Calling
Reply:bad brains.. i against i
When I execute a 'C' program in my system I'am getting an error that "unable to open include files".
please suggest me how to add that incude files to execute my program.
When I execute a 'C' program in my system I'am getting an error that "unable to open include files".
we can help u out of u can provide the name of compiler u r Using..?
if u r compiling the program in TC.. thn u hav to add these two entries :
"[tc Home]/INCLUDE" in Include Directories and "[tc Home]/lib" in Library Directories ..
To do so.. Select 'Option ' menu then 'Directories' sub-menu.
Reply:I write in VB, but the process is the same upon compilation, in the package and deployment of your program, you'll need to include any dynamic link libraries etc etc.. to be registered with your program via system32's regsrv.exe
good luck
Reply:Hi,
There can be two basic reason.
First I hope you are using Turbo C Compiler
One is that you need to write # include %26lt;whatever the header you want%26gt;
e.g. # include %26lt;stdio.h%26gt;
Check if you wrote # include "stdio.h", as some book says you can write this, but there is some other meaning for this. So prefer the triangular bracket
Secondly
Check this settings...
Go to Options %26gt; Directories.
There you need to give the path of wherever your header files and library files are placed...
preferrable
%26lt;your tc path%26gt;\INCLUDE
%26lt;your c path%26gt;\LIB
eg. C:\TC\INCLUDE
C: \TC\LIB
you can find where your header files are placed by going inside the directory and searching for *.h
Reply:u might have installed u r c software in some drive and moved that to some other drive or a different location than u have installed so change the include directories option or the best way is to install that where ever u want it..........and run u r saved file
rose
When I execute a 'C' program in my system I'am getting an error that "unable to open include files".
we can help u out of u can provide the name of compiler u r Using..?
if u r compiling the program in TC.. thn u hav to add these two entries :
"[tc Home]/INCLUDE" in Include Directories and "[tc Home]/lib" in Library Directories ..
To do so.. Select 'Option ' menu then 'Directories' sub-menu.
Reply:I write in VB, but the process is the same upon compilation, in the package and deployment of your program, you'll need to include any dynamic link libraries etc etc.. to be registered with your program via system32's regsrv.exe
good luck
Reply:Hi,
There can be two basic reason.
First I hope you are using Turbo C Compiler
One is that you need to write # include %26lt;whatever the header you want%26gt;
e.g. # include %26lt;stdio.h%26gt;
Check if you wrote # include "stdio.h", as some book says you can write this, but there is some other meaning for this. So prefer the triangular bracket
Secondly
Check this settings...
Go to Options %26gt; Directories.
There you need to give the path of wherever your header files and library files are placed...
preferrable
%26lt;your tc path%26gt;\INCLUDE
%26lt;your c path%26gt;\LIB
eg. C:\TC\INCLUDE
C: \TC\LIB
you can find where your header files are placed by going inside the directory and searching for *.h
Reply:u might have installed u r c software in some drive and moved that to some other drive or a different location than u have installed so change the include directories option or the best way is to install that where ever u want it..........and run u r saved file
rose
I`m a beginer in "c" language.When i try to compile it says :unable to open include file"iostream" and ...
it says undefined symbol cout in function main().plz give me the solution.
I use BCC 5.5
I`m a beginer in "c" language.When i try to compile it says :unable to open include file"iostream" and ...
There is no iostream or cout in the "c" language.
Is your program in C++ instead?
If so, try giving it a different extension, like .cpp instead of .c
If that doesn't fix the problem you just need to change the include directory that BCC 5.5 searches.
Reply:iostream and cout are in the C++ standard library so make sure that you are using a C++ compiler and that your file has a .cpp, .cc, or .cxx extension so the compiler treats it as C++.
Good luck!
Reply:you have an option called window in your turboc editor.In it, select path and check whether that path is leading to your BCC 5.5 directory or not. it is the only problem
Reply:make sure the line where you include the file is correct. For instance, the file should be iostream.h, not just iostream. The compiler has a standard set of directories to look for includes, and I can't imagine one that would not include the normal ones in it's default path, but if you're sure the include statement is correct, then look at the documentation for your compiler, see where it searches, and then see why that file isn't there.
Reply:Either you have typo in the #include %26lt;iostream.h%26gt; line
Or your installation is bad (gotta reinstall there)
I use BCC 5.5
I`m a beginer in "c" language.When i try to compile it says :unable to open include file"iostream" and ...
There is no iostream or cout in the "c" language.
Is your program in C++ instead?
If so, try giving it a different extension, like .cpp instead of .c
If that doesn't fix the problem you just need to change the include directory that BCC 5.5 searches.
Reply:iostream and cout are in the C++ standard library so make sure that you are using a C++ compiler and that your file has a .cpp, .cc, or .cxx extension so the compiler treats it as C++.
Good luck!
Reply:you have an option called window in your turboc editor.In it, select path and check whether that path is leading to your BCC 5.5 directory or not. it is the only problem
Reply:make sure the line where you include the file is correct. For instance, the file should be iostream.h, not just iostream. The compiler has a standard set of directories to look for includes, and I can't imagine one that would not include the normal ones in it's default path, but if you're sure the include statement is correct, then look at the documentation for your compiler, see where it searches, and then see why that file isn't there.
Reply:Either you have typo in the #include %26lt;iostream.h%26gt; line
Or your installation is bad (gotta reinstall there)
I'm doing a basic set of accounts for a small club, do i include our assets in the profit and loss a/c?
Profit and Loss - fixed assets are they considered when producing the profit and loss account. i.e. if the club has made a loss in the year of 5k and the fixed assets amount to 4.5k is that considered a loss of 500. and vice versa in respect of a profit?
I'm doing a basic set of accounts for a small club, do i include our assets in the profit and loss a/c?
Normally the only way you use assets in a P%26amp;L is depreciation and possibly amortization- The Assets show up on the balsnce sheet.
Reply:Listen to the guy with 40 years experience he knows what he is talking about..........
Reply:Very simple!Fixed asset are not considered in p%26amp;l acc.What is concidered in p%26amp;l acc. is the depreciation of an asset value.
If the buz made a loos it is non of the buz of fixed asset ,but the buz itself.All that will go to p%26amp;l acc is the depreciation which will also reflect in your balansheet at end of the financial year.For example,if you decide to charge 5k per year for an asset of 60k with a life span of 12 years.It means that, 5k will be charge to p%26amp;l as depreciation each financial year and same amount post to balansheet to reduce the value of the asset.Which means that the value of the asset in the second year will be 55k, which will continue reducing for the period of 12years.
Hope is answerd? if not, lets share your worries.
Regards.
Reply:Fixed assets don't appear in the P %26amp; L. They would appear in the Balance Sheet.
The P %26amp; L is, crudely, what might be called an "income %26amp; outoings" account.
I'm doing a basic set of accounts for a small club, do i include our assets in the profit and loss a/c?
Normally the only way you use assets in a P%26amp;L is depreciation and possibly amortization- The Assets show up on the balsnce sheet.
Reply:Listen to the guy with 40 years experience he knows what he is talking about..........
Reply:Very simple!Fixed asset are not considered in p%26amp;l acc.What is concidered in p%26amp;l acc. is the depreciation of an asset value.
If the buz made a loos it is non of the buz of fixed asset ,but the buz itself.All that will go to p%26amp;l acc is the depreciation which will also reflect in your balansheet at end of the financial year.For example,if you decide to charge 5k per year for an asset of 60k with a life span of 12 years.It means that, 5k will be charge to p%26amp;l as depreciation each financial year and same amount post to balansheet to reduce the value of the asset.Which means that the value of the asset in the second year will be 55k, which will continue reducing for the period of 12years.
Hope is answerd? if not, lets share your worries.
Regards.
Reply:Fixed assets don't appear in the P %26amp; L. They would appear in the Balance Sheet.
The P %26amp; L is, crudely, what might be called an "income %26amp; outoings" account.
How do I type a equation that include the symbol Pi ? Example = Fc = 1 / 2*Pi*R*C.?
The symbol for Pi is in the ASCII table number 227. If your using microsoft windows hold down the 'alt' key and type in '227' on the number pad, then release the 'alt' key. This should create the Pi charactor you are looking for. Example: π
How do I type a equation that include the symbol Pi ? Example = Fc = 1 / 2*Pi*R*C.?
With "num lock" on, hold down the ALT key, then type "227" on keypad on the right (not the line of numbers above the letters) then let go of ALT and it should appear. π
Hope that helps!
Reply:there should be a constant for this reason.
i donno which program you mean, so i could help better
How do I type a equation that include the symbol Pi ? Example = Fc = 1 / 2*Pi*R*C.?
With "num lock" on, hold down the ALT key, then type "227" on keypad on the right (not the line of numbers above the letters) then let go of ALT and it should appear. π
Hope that helps!
Reply:there should be a constant for this reason.
i donno which program you mean, so i could help better
I am using Borland C++ 5.5 compiler. I wrote the code and I added #include <graphics.h>,an error displayed
The error says" Unable to open %26lt;graphics.h%26gt;". Is there a missed "graphics" library in the Borland compiler?
I installed "graphics.h" from another site, but more errors appear especially in this library:(
What is the solution? any answer will be appreciated..
I am using Borland C++ 5.5 compiler. I wrote the code and I added #include %26lt;graphics.h%26gt;,an error displayed
Try #include "graphics.h" and put graphics.h in the same directory as your code.
flowering plum
I installed "graphics.h" from another site, but more errors appear especially in this library:(
What is the solution? any answer will be appreciated..
I am using Borland C++ 5.5 compiler. I wrote the code and I added #include %26lt;graphics.h%26gt;,an error displayed
Try #include "graphics.h" and put graphics.h in the same directory as your code.
flowering plum
What is difference between #include and #define? and also what about inline and macro in c, c++?
#include tells the compiler to compile the specified file along with the source.
#define is used for macros; for example, you could use
#define min( a, b ) ( ( a ) %26gt; ( b ) ? ( b ) : ( a ) )
just like you would a function; however, it won't check your types, and your arguments may have unintended effects. The difference from inline is that the compiler will replace the "calls" to the macro with the actual text before compilation.
It can also be used to define constants, such as
#define e 2.718282f
inline tells the compiler to insert the function body wherever it is called; this eliminates the overhead of the function call. It is better to use inline functions over function like macros whenever possible.
What is difference between #include and #define? and also what about inline and macro in c, c++?
#include includes a file
#define means creating the static value.
ex: #include %26lt;stdio.h%26gt;
here including the header file .
#define venkat printf
we can use this as printf
ex:
venkat("This is venkatesh");
Reply:hi
#include is used to include a header file into a c/c++ program
#define is used to define a constant eg- #define pi 3.14
inline are function defined inside a class
i forgot wat a macro is
gud luc
#define is used for macros; for example, you could use
#define min( a, b ) ( ( a ) %26gt; ( b ) ? ( b ) : ( a ) )
just like you would a function; however, it won't check your types, and your arguments may have unintended effects. The difference from inline is that the compiler will replace the "calls" to the macro with the actual text before compilation.
It can also be used to define constants, such as
#define e 2.718282f
inline tells the compiler to insert the function body wherever it is called; this eliminates the overhead of the function call. It is better to use inline functions over function like macros whenever possible.
What is difference between #include and #define? and also what about inline and macro in c, c++?
#include includes a file
#define means creating the static value.
ex: #include %26lt;stdio.h%26gt;
here including the header file .
#define venkat printf
we can use this as printf
ex:
venkat("This is venkatesh");
Reply:hi
#include is used to include a header file into a c/c++ program
#define is used to define a constant eg- #define pi 3.14
inline are function defined inside a class
i forgot wat a macro is
gud luc
In C language How to write some functions in header file and include it to the main program.?
WIthin c language you have can do functions as define within the header file.
For instance:
#if defined(linux) || defined(__APPLE__)
# if !defined(TRUE)
# define TRUE 1
# endif
# if !defined(FALSE)
# define FALSE 0
# endif
# if !defined(max)
# define max(a,b) (((a) %26gt; (b)) ? (a) : (b))
# endif
# if !defined(min)
# define min(a,b) (((a) %26lt; (b)) ? (a) : (b))
# endif
# if !defined(MB_OK)
# define MB_OK 0
# endif
# if !defined(Sleep)
# define Sleep(x) usleep((x) * 1000)
# endif
#endif /* linux || __APPLE__ */
Or you could do something like this which is a macro.
#define TEST_DEVICE(X) (((X).errorCode) != HD_SUCCESS)
So usually within header files we just include typedefs, defines, and functions.
IF we include functions, then in the main class we implement those functions. Think of it as a interface.
For instance:
index.h
=================================
void hdBeginFrame(int hHD);
void hdEndFrame(int hHD);
index.c
=====================
void hdBeginFrame(int hHD) {
.....
}
So instead of declaring the functions in your .c file at the beginning , you could do them within the header file.
IT acts as a interface in other languages. The reason why we have .h files is simple portability. When developers compile their code or module into dlls or so objects and they want their clients to use them, they can check the .h files to see which functions are included within that dll.
That is how we can do it. :)
In C language How to write some functions in header file and include it to the main program.?
just define or declare the functiom in the header file and do the rest in ur C code. But ermember to include the header file. And keep notice of %26lt; and "
Reply:you can save you code in .h extention and you can include that code in any of your project.
Reply:You can write the functions in the header file if you like, be sure to include the necessary class declarations and header file declarations in the .cpp. You could also place your functions at the end of your main function in the .cpp
Reply:Write your functions in a C file (with extension .c) and then include that file in any other C program using double quotes:
#include"file.c"
Note: Your file.c should be in same folder in which you C program which is using file.c, is kept.
Reply:1)lets say u have function name myfunc() in Function.h
void MyFunc();
2)now make a Function.cpp file and write following lines in it
void MyFunc()
{
printf("hello");
}
now, make another file named Main.c , which contains ur main() method
Include function.h in ur main.c file by putting this line at the top
%26lt;#inculde function.h%26gt;
Then goes the main() function
void main()
{
//call myfunc to print on the screen
MyFunc();
}
For instance:
#if defined(linux) || defined(__APPLE__)
# if !defined(TRUE)
# define TRUE 1
# endif
# if !defined(FALSE)
# define FALSE 0
# endif
# if !defined(max)
# define max(a,b) (((a) %26gt; (b)) ? (a) : (b))
# endif
# if !defined(min)
# define min(a,b) (((a) %26lt; (b)) ? (a) : (b))
# endif
# if !defined(MB_OK)
# define MB_OK 0
# endif
# if !defined(Sleep)
# define Sleep(x) usleep((x) * 1000)
# endif
#endif /* linux || __APPLE__ */
Or you could do something like this which is a macro.
#define TEST_DEVICE(X) (((X).errorCode) != HD_SUCCESS)
So usually within header files we just include typedefs, defines, and functions.
IF we include functions, then in the main class we implement those functions. Think of it as a interface.
For instance:
index.h
=================================
void hdBeginFrame(int hHD);
void hdEndFrame(int hHD);
index.c
=====================
void hdBeginFrame(int hHD) {
.....
}
So instead of declaring the functions in your .c file at the beginning , you could do them within the header file.
IT acts as a interface in other languages. The reason why we have .h files is simple portability. When developers compile their code or module into dlls or so objects and they want their clients to use them, they can check the .h files to see which functions are included within that dll.
That is how we can do it. :)
In C language How to write some functions in header file and include it to the main program.?
just define or declare the functiom in the header file and do the rest in ur C code. But ermember to include the header file. And keep notice of %26lt; and "
Reply:you can save you code in .h extention and you can include that code in any of your project.
Reply:You can write the functions in the header file if you like, be sure to include the necessary class declarations and header file declarations in the .cpp. You could also place your functions at the end of your main function in the .cpp
Reply:Write your functions in a C file (with extension .c) and then include that file in any other C program using double quotes:
#include"file.c"
Note: Your file.c should be in same folder in which you C program which is using file.c, is kept.
Reply:1)lets say u have function name myfunc() in Function.h
void MyFunc();
2)now make a Function.cpp file and write following lines in it
void MyFunc()
{
printf("hello");
}
now, make another file named Main.c , which contains ur main() method
Include function.h in ur main.c file by putting this line at the top
%26lt;#inculde function.h%26gt;
Then goes the main() function
void main()
{
//call myfunc to print on the screen
MyFunc();
}
Which is a good Programming language for beginners? C or CPP or Java or anything else including C#?
Which is a good Programming language for beginners? C or CPP or Java or anything else including C#
Which is a good Programming language for beginners? C or CPP or Java or anything else including C#?
Java. The nomenclature is a bit easier (the names of classes and methods are usually pretty obvious to a non-programmer, while C isn't always like that.) Aside from the ease of use, there are a truckload of books on Java that are designed for newbie programmers.
Good luck.
Reply:c is good and its the basic. If u gain a superior knowledge in c then c++ goes hand in hand and same with other programming language.
Reply:For beginners its obviously C, then after it C++,JAVA %26amp; C# in a step by step manner only.
If they can then they shall go for any language. Its not difficult to learn any language.
Reply:C#
Reply:C is the basic language for all the languages .
Whether u learn cpp,c# you suppose to have a knowledge
of c .
I think java is the good programing language which much
easy to understand than cpp.
Reply:Java
very simple and easy, and has no pointers to use
Reply:Any Problem Ask An Expert And Get Professional Help
at
http://directcegree.info
http://www.geocities.com/programinghelps
Reply:Obiviously C, to start studying programming languages C is best to start with.
C is basic language to develope logic and programming skills.
for all othre languages C is base.
Which is a good Programming language for beginners? C or CPP or Java or anything else including C#?
Java. The nomenclature is a bit easier (the names of classes and methods are usually pretty obvious to a non-programmer, while C isn't always like that.) Aside from the ease of use, there are a truckload of books on Java that are designed for newbie programmers.
Good luck.
Reply:c is good and its the basic. If u gain a superior knowledge in c then c++ goes hand in hand and same with other programming language.
Reply:For beginners its obviously C, then after it C++,JAVA %26amp; C# in a step by step manner only.
If they can then they shall go for any language. Its not difficult to learn any language.
Reply:C#
Reply:C is the basic language for all the languages .
Whether u learn cpp,c# you suppose to have a knowledge
of c .
I think java is the good programing language which much
easy to understand than cpp.
Reply:Java
very simple and easy, and has no pointers to use
Reply:Any Problem Ask An Expert And Get Professional Help
at
http://directcegree.info
http://www.geocities.com/programinghelps
Reply:Obiviously C, to start studying programming languages C is best to start with.
C is basic language to develope logic and programming skills.
for all othre languages C is base.
Does anybody know the source code of program password in turbo C?
does anybody know the source code of program password in turbo C?
#include%26lt;stdio.h%26gt;
main()
{
char password,ppp;
printf("password:");
scanf("%s",%26amp;ppp);
if(password==ppp)
printf("correct");
else
printf("wrong");
getch();
}
this is a wrong one
Does anybody know the source code of program password in turbo C?
there is no direct way to get password chars as "*********" in turbo c. if you need this you have to do it by yourself. i mean you have to get input from user one character at a time and print them as " * ".
Here's a demo:
#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
main()
{
char c;
char ppp[20] = "my_password"; // correct password
char password[20];
int cnt=0;
printf("password:");
while( (c=getch()) != 13 ) // 13 is the code for enter
{
password[cnt] = c;
printf("*");
cnt++;
}
password[cnt] = '\0';
if(password==ppp)
printf("correct");
else
printf("wrong");
getch();
}
nil
#include%26lt;stdio.h%26gt;
main()
{
char password,ppp;
printf("password:");
scanf("%s",%26amp;ppp);
if(password==ppp)
printf("correct");
else
printf("wrong");
getch();
}
this is a wrong one
Does anybody know the source code of program password in turbo C?
there is no direct way to get password chars as "*********" in turbo c. if you need this you have to do it by yourself. i mean you have to get input from user one character at a time and print them as " * ".
Here's a demo:
#include%26lt;stdio.h%26gt;
#include%26lt;conio.h%26gt;
main()
{
char c;
char ppp[20] = "my_password"; // correct password
char password[20];
int cnt=0;
printf("password:");
while( (c=getch()) != 13 ) // 13 is the code for enter
{
password[cnt] = c;
printf("*");
cnt++;
}
password[cnt] = '\0';
if(password==ppp)
printf("correct");
else
printf("wrong");
getch();
}
nil
How do you write an 8 measure melody in any major scale?(Include key signature and it has to be in 4/4)?
I need to make this for a class but i dont know ANYTHING on how to do this... "How do you write an 8 measure melody in any major scale?(Except C)(Include key signature and it has to be in 4/4)" Can someone help me out?
How do you write an 8 measure melody in any major scale?(Include key signature and it has to be in 4/4)?
Duh, just make up a melody! If you'd have been paying attention in class, you'd know how to write it!
Reply:ask a butcher
How do you write an 8 measure melody in any major scale?(Include key signature and it has to be in 4/4)?
Duh, just make up a melody! If you'd have been paying attention in class, you'd know how to write it!
Reply:ask a butcher
I cant' figure whats wrong w/my C++ program!HELP!?
So im supposd to write a program that calculates
the sum of 1/n! (1 divided by n factorial) , n=1 to 100
or n=1 below the Sigma sign, 100 above, 1/n1 on the right of the sigma sign
This is my program:
keep in mund C++
#include %26lt;iostream%26gt;
using namespace std;
int main ()
{
int i,fact=1,sum;
for(i=1;i%26lt;=100;i++)
{ fact = fact * i;
sum = 1/fact;
cout%26lt;%26lt;sum;
}
return 0;
}
after i compile link it and execute it i get a message saying
Arithmetic Exception (core dumped)
What is that?
Help please who ever is out there.
I cant' figure whats wrong w/my C++ program!HELP!?
This program has a lot of issues
1stly, you should 1st initialize sum to 0 and then use
sum+= 1/fact (because you want the summation and not each of them individually)
the second problem is, that you should be declaring sum as a double and not an int.
int x=1/2 //implies x=0
double x=1.0/2 //implies x=0.5
this brings me to the 3rd problem.
1/fact will always be zero since 1%26lt;fact and both are ints. you need to write that as 1.0/fact
and to wind it up, one last problem, fact(100) is a really large number. it cant be stored as an integer. I am too lazy to try, but I am pretty sure you cant store it as a long either. you will get overflows of numbers (number turning into a negative number), which will skew your results.
I am appending a similar program. see if it makes sense to you
#include %26lt;iostream%26gt;
using namespace std;
int main ()
{
int i,fact=1;
double sum=0; //sum is now double and initialized to 0
for(i=1;i%26lt;=10;i++) //10 and not 100
{
fact *= i;
sum += 1.0/fact; //adding to sum. also 1.0 and not 1
cout%26lt;%26lt;sum%26lt;%26lt;endl; //appending a newline. this helps bufferring the stream and you catch errors better
}
return 0;
}
All the best
Reply:Make sure fact is not 0 at all... I know
you intialied fact before the i loop to one...
but does it stay above 0 all the time in the loop...
usually a arithmetic expcetion means
you try to divide a 0 or...
the division symbol is not the right one..
since it's integer...
remember you are not getting integer result 1/2 is .50
here is what you can do to see what is the probem
take out the sum=1/fact for now and put a
cout %26lt;%26lt; fact %26lt;%26lt; endl; to see if fact is putting out the right numbers... if not than you know..
if it seems right...
put back the sum=1/fact;
but check to see if you are allowed to use / because you are getting a decimal value and you may have to use..
the var real...
Reply:try unsigned long i,fact=1,sum;
instead of int i,fact=1,sum;
the sum of 1/n! (1 divided by n factorial) , n=1 to 100
or n=1 below the Sigma sign, 100 above, 1/n1 on the right of the sigma sign
This is my program:
keep in mund C++
#include %26lt;iostream%26gt;
using namespace std;
int main ()
{
int i,fact=1,sum;
for(i=1;i%26lt;=100;i++)
{ fact = fact * i;
sum = 1/fact;
cout%26lt;%26lt;sum;
}
return 0;
}
after i compile link it and execute it i get a message saying
Arithmetic Exception (core dumped)
What is that?
Help please who ever is out there.
I cant' figure whats wrong w/my C++ program!HELP!?
This program has a lot of issues
1stly, you should 1st initialize sum to 0 and then use
sum+= 1/fact (because you want the summation and not each of them individually)
the second problem is, that you should be declaring sum as a double and not an int.
int x=1/2 //implies x=0
double x=1.0/2 //implies x=0.5
this brings me to the 3rd problem.
1/fact will always be zero since 1%26lt;fact and both are ints. you need to write that as 1.0/fact
and to wind it up, one last problem, fact(100) is a really large number. it cant be stored as an integer. I am too lazy to try, but I am pretty sure you cant store it as a long either. you will get overflows of numbers (number turning into a negative number), which will skew your results.
I am appending a similar program. see if it makes sense to you
#include %26lt;iostream%26gt;
using namespace std;
int main ()
{
int i,fact=1;
double sum=0; //sum is now double and initialized to 0
for(i=1;i%26lt;=10;i++) //10 and not 100
{
fact *= i;
sum += 1.0/fact; //adding to sum. also 1.0 and not 1
cout%26lt;%26lt;sum%26lt;%26lt;endl; //appending a newline. this helps bufferring the stream and you catch errors better
}
return 0;
}
All the best
Reply:Make sure fact is not 0 at all... I know
you intialied fact before the i loop to one...
but does it stay above 0 all the time in the loop...
usually a arithmetic expcetion means
you try to divide a 0 or...
the division symbol is not the right one..
since it's integer...
remember you are not getting integer result 1/2 is .50
here is what you can do to see what is the probem
take out the sum=1/fact for now and put a
cout %26lt;%26lt; fact %26lt;%26lt; endl; to see if fact is putting out the right numbers... if not than you know..
if it seems right...
put back the sum=1/fact;
but check to see if you are allowed to use / because you are getting a decimal value and you may have to use..
the var real...
Reply:try unsigned long i,fact=1,sum;
instead of int i,fact=1,sum;
Where can i get c++ programs on internet readymade like c++ programs using class yaar i want it like # include
I do not know about that but i am having the knowledge of c,c++ .
So I will help you . You specify which type of programing concept you want. My id is goan_bala@yahoo.co.in.
I will help you man.
Where can i get c++ programs on internet readymade like c++ programs using class yaar i want it like # include
ok
Reply:try these sites:
codeguru.com
codeproject.com
planet-source-code.com
1cplusplusstreet.com
programmersheaven.com
Reply:Hi ,
Go for the sourcecodesworld.com..
Even i prefer you will subscribe to Vyoms.com - A website thats offer lots of good stuff to freshers and experience people..
With REgds,
Bharat
So I will help you . You specify which type of programing concept you want. My id is goan_bala@yahoo.co.in.
I will help you man.
Where can i get c++ programs on internet readymade like c++ programs using class yaar i want it like # include
ok
Reply:try these sites:
codeguru.com
codeproject.com
planet-source-code.com
1cplusplusstreet.com
programmersheaven.com
Reply:Hi ,
Go for the sourcecodesworld.com..
Even i prefer you will subscribe to Vyoms.com - A website thats offer lots of good stuff to freshers and experience people..
With REgds,
Bharat
I need help with my c++ compiler...?
i am using dev-c++4 as my compiler and i put this in
// my first program in C++
#include %26lt;iostream%26gt;
using namespace std;
int main ()
{
cout %26lt;%26lt; "Hello World!";
return 0;
}
then i compile it and it says i have no errors. so i push execute and nothing happens. wat am i doing wrong?
I need help with my c++ compiler...?
First, make sure you clicked both compile and build (you can also just click build directly).
Run your program from the command line. If you don’t want to, you can put in a (acceptable for beginners only) kludge by adding cin.get() to the end of main. See Google for the problem of C++ program closing too quickly.
Finally, I want to correct a technical error in your choice of words. But it’s critical you learn to make this distinction. Dev-C++ is what is known as an IDE. It is not a compiler itself. Your compiler is MingW (that’s what Dev-C++ is designed to use). MingW is the windows port of the gcc compiler. Knowing these details will help you with your Googling efforts.
Reply:....
cout %26lt;%26lt; "Hello World!";
cin.get();
....
Reply:Your program did work, it outputs Hello World but it was so fast you couldn't see it. Youre next line after the cout line should be a cin statement. The screen will pause for the cin, and you will see your Hello World. Then when you hit enter, the program will finish executing and exit. Without a line to pause the program (cin), the program executes, displays hello world, finishes executing and closes, fast enough where you didn't think anything happened.
Reply:You're program should compile fine, no errors. Did you start a console project, if so, you should use command line or dos box if on windows to run it.
Take a look on http://www.nextdawn.nl for a great series of C and C++ tutorials (they also explain compiling).
sp
// my first program in C++
#include %26lt;iostream%26gt;
using namespace std;
int main ()
{
cout %26lt;%26lt; "Hello World!";
return 0;
}
then i compile it and it says i have no errors. so i push execute and nothing happens. wat am i doing wrong?
I need help with my c++ compiler...?
First, make sure you clicked both compile and build (you can also just click build directly).
Run your program from the command line. If you don’t want to, you can put in a (acceptable for beginners only) kludge by adding cin.get() to the end of main. See Google for the problem of C++ program closing too quickly.
Finally, I want to correct a technical error in your choice of words. But it’s critical you learn to make this distinction. Dev-C++ is what is known as an IDE. It is not a compiler itself. Your compiler is MingW (that’s what Dev-C++ is designed to use). MingW is the windows port of the gcc compiler. Knowing these details will help you with your Googling efforts.
Reply:....
cout %26lt;%26lt; "Hello World!";
cin.get();
....
Reply:Your program did work, it outputs Hello World but it was so fast you couldn't see it. Youre next line after the cout line should be a cin statement. The screen will pause for the cin, and you will see your Hello World. Then when you hit enter, the program will finish executing and exit. Without a line to pause the program (cin), the program executes, displays hello world, finishes executing and closes, fast enough where you didn't think anything happened.
Reply:You're program should compile fine, no errors. Did you start a console project, if so, you should use command line or dos box if on windows to run it.
Take a look on http://www.nextdawn.nl for a great series of C and C++ tutorials (they also explain compiling).
sp
Powers in c?
sorry to bother you all again, but I am struggling with powers in c.
#include %26lt;iostream%26gt;
int main(){
for (int i = 0; i %26lt; 20; i++){
printf("2 ^ %d = %d \n", i, 2^i);
}
}
returns
2 ^ 0 = 2
2 ^ 1 = 3
2 ^ 2 = 2...
what am I doing wrong? and what is the ^ opperator if not power?
Powers in c?
Why don't you use the function pow(x,y) in %26lt;math.h%26gt;??
"^" is a bitwise operator (XOR)
Reply:^ I think is a bit-wise operator in C.
There is no exponent function native in C unless one's burried in the math libraries.
But I think this excersize is supposed to force you to create the function, passing in x and y).
Reply:#include %26lt;iostream%26gt;
#include%26lt;math.h%26gt;
int main(){
for (int i = 0; i %26lt; 20; i++){
printf("2 ^ %d = %d \n", i, pow(2,i));
}
}
try to run this program you will get correct answer.
#include %26lt;iostream%26gt;
int main(){
for (int i = 0; i %26lt; 20; i++){
printf("2 ^ %d = %d \n", i, 2^i);
}
}
returns
2 ^ 0 = 2
2 ^ 1 = 3
2 ^ 2 = 2...
what am I doing wrong? and what is the ^ opperator if not power?
Powers in c?
Why don't you use the function pow(x,y) in %26lt;math.h%26gt;??
"^" is a bitwise operator (XOR)
Reply:^ I think is a bit-wise operator in C.
There is no exponent function native in C unless one's burried in the math libraries.
But I think this excersize is supposed to force you to create the function, passing in x and y).
Reply:#include %26lt;iostream%26gt;
#include%26lt;math.h%26gt;
int main(){
for (int i = 0; i %26lt; 20; i++){
printf("2 ^ %d = %d \n", i, pow(2,i));
}
}
try to run this program you will get correct answer.
Can a C programmer help me?
I don't understand this function called "streql" (it tests if 2 strings are equal, and it returns 1 if they are, and 0 if not...)
Here is the code, in C:
#include %26lt;stdio.h%26gt;
int streql (char *str1, char *str2)
{
while ((*str1 == *str2) %26amp;%26amp; (*str1))
{
str1++;
str2++;
}
return ((*str1 == NULL) %26amp;%26amp; (*str2 == NULL));
}
void main (void)
{
printf("Testing Abc si Abc %d\n", streql("Abc", "Abc"));
printf("Testing abc si Abc %d\n", streql("abc", "Abc"));
printf("Testing abcd si abc %d\n", streql("abcd", "abc"));
}
Can you explain me what is the logic of what is written in the "while", and what is the logic of what is written inside the "return"?
Can a C programmer help me?
Look at the while loop
its condition is to check if the 2 pointers point to equal values.
also it checks if the first pointer is not equal to ZERO which means that the first string has ended. if the condition comes true then advance to the next char for both strings. the return statement checks if both strings had ended. if both ended then they match
Take the following example,
"ABCD", "ABCD"
at first *str1 = 'A' and *str2 = 'A' and *str1 != NULL, so advance
*str1 = 'B' and *str2 = 'B' and *str1 != NULL, advance,
.
.
.
at the end *str1 equals NULL after finishing the 'D' check then the while loop terminates
then the return statement checks if both pointers point to NULL (the two strings finished then it returns true.
Reply:A string of characters is a sequence of 0 or more ASCII characters, sequence which the C language ends with the character called NULL (ASCII 0). Report It
Reply:The difference between 'A' and "A":
--- --- --- --- --- --- --- ---
A A \0
--- --- --- --- --- --- --- ---
'A' "A" Report It
Reply:I found your question under immigration? Try putting it under another category. There is one for computer or programming. Signed COBOL programmer.
Reply:while ((*str1 == *str2) %26amp;%26amp; (*str1))
{
str1++;
str2++;
}
return ((*str1 == NULL) %26amp;%26amp; (*str2 == NULL));
str1 and str2 are pointers. The character pointed to moves one to the right each time you execute str1++ or str2++, respectively. "*str1" means what character the pointer str1 is currently pointing at. So the while statement says, while the character pointed to by str1 is the same as the character pointed to by str2 AND while the character pointed to by str1 is not 0 (meaning is not the null character that terminates string str1), then increment the pointers str1 and str2 to go to the next character.
The return statement means to return true if the thing pointed to by str1 is NULL and the thing pointed to by str2 is NULL.
This is a defective function, as far as I'm concerned. You should exit the while loop as soon as there is a difference found in the two strings or as soon as you get to the end of str1. But at that point *str1 should be 0 and *str2 should be 0 if the strings are equal. str1 and str2 are pointers, but *str1 and *str2 are NOT pointers, they are characters. To compare characters to NULL may work, but it is very bad programming. The return statement should say return (*str1 == 0) %26amp;%26amp; (*str2 == 0).
Here is the code, in C:
#include %26lt;stdio.h%26gt;
int streql (char *str1, char *str2)
{
while ((*str1 == *str2) %26amp;%26amp; (*str1))
{
str1++;
str2++;
}
return ((*str1 == NULL) %26amp;%26amp; (*str2 == NULL));
}
void main (void)
{
printf("Testing Abc si Abc %d\n", streql("Abc", "Abc"));
printf("Testing abc si Abc %d\n", streql("abc", "Abc"));
printf("Testing abcd si abc %d\n", streql("abcd", "abc"));
}
Can you explain me what is the logic of what is written in the "while", and what is the logic of what is written inside the "return"?
Can a C programmer help me?
Look at the while loop
its condition is to check if the 2 pointers point to equal values.
also it checks if the first pointer is not equal to ZERO which means that the first string has ended. if the condition comes true then advance to the next char for both strings. the return statement checks if both strings had ended. if both ended then they match
Take the following example,
"ABCD", "ABCD"
at first *str1 = 'A' and *str2 = 'A' and *str1 != NULL, so advance
*str1 = 'B' and *str2 = 'B' and *str1 != NULL, advance,
.
.
.
at the end *str1 equals NULL after finishing the 'D' check then the while loop terminates
then the return statement checks if both pointers point to NULL (the two strings finished then it returns true.
Reply:A string of characters is a sequence of 0 or more ASCII characters, sequence which the C language ends with the character called NULL (ASCII 0). Report It
Reply:The difference between 'A' and "A":
--- --- --- --- --- --- --- ---
A A \0
--- --- --- --- --- --- --- ---
'A' "A" Report It
Reply:I found your question under immigration? Try putting it under another category. There is one for computer or programming. Signed COBOL programmer.
Reply:while ((*str1 == *str2) %26amp;%26amp; (*str1))
{
str1++;
str2++;
}
return ((*str1 == NULL) %26amp;%26amp; (*str2 == NULL));
str1 and str2 are pointers. The character pointed to moves one to the right each time you execute str1++ or str2++, respectively. "*str1" means what character the pointer str1 is currently pointing at. So the while statement says, while the character pointed to by str1 is the same as the character pointed to by str2 AND while the character pointed to by str1 is not 0 (meaning is not the null character that terminates string str1), then increment the pointers str1 and str2 to go to the next character.
The return statement means to return true if the thing pointed to by str1 is NULL and the thing pointed to by str2 is NULL.
This is a defective function, as far as I'm concerned. You should exit the while loop as soon as there is a difference found in the two strings or as soon as you get to the end of str1. But at that point *str1 should be 0 and *str2 should be 0 if the strings are equal. str1 and str2 are pointers, but *str1 and *str2 are NOT pointers, they are characters. To compare characters to NULL may work, but it is very bad programming. The return statement should say return (*str1 == 0) %26amp;%26amp; (*str2 == 0).
Plz help with this c++ program?
a. Write a pseudo-code that prompt the user to input number of old items and then receive the sold value for each item, calculate the average value, display the items numbers associated with its values and display also the calculated average value on the screen.
b. write down the C++ code for the previous program.
Well... I tried to solve it and here we go:
* Pseudo-code:
start
get sold items,sold value
average=sold value/sold items
Display sold items,sold value
Display average
* C++:
#include%26lt;iostream.h%26gt;
void main()
{
int NumOfSold,SolValue;
float average;
cout%26lt;%26lt;"enter the number of sold items\n";
cin%26gt;%26gt;NumOfSold;
cout%26lt;%26lt;"enter the sold value for each item\n";
cin%26gt;%26gt;SolValue;
average=(float)SolValue/NumOfSold;
cout%26lt;%26lt;NumOfSold%26lt;%26lt;":"%26lt;%26lt;SolValue%26lt;%26lt;endl;
cout%26lt;%26lt;"average:"%26lt;%26lt;average;
}
Plz help with this c++ program?
So, what is the result?
Reply:Did you run it to see if it works? If it works, then it's right, if it doesn't, then you'll have to debug things to make it work.
After looking at it for 2 seconds, it looks right, but that doesn't mean it is. The only way to be sure is to compile it and test it.
b. write down the C++ code for the previous program.
Well... I tried to solve it and here we go:
* Pseudo-code:
start
get sold items,sold value
average=sold value/sold items
Display sold items,sold value
Display average
* C++:
#include%26lt;iostream.h%26gt;
void main()
{
int NumOfSold,SolValue;
float average;
cout%26lt;%26lt;"enter the number of sold items\n";
cin%26gt;%26gt;NumOfSold;
cout%26lt;%26lt;"enter the sold value for each item\n";
cin%26gt;%26gt;SolValue;
average=(float)SolValue/NumOfSold;
cout%26lt;%26lt;NumOfSold%26lt;%26lt;":"%26lt;%26lt;SolValue%26lt;%26lt;endl;
cout%26lt;%26lt;"average:"%26lt;%26lt;average;
}
Plz help with this c++ program?
So, what is the result?
Reply:Did you run it to see if it works? If it works, then it's right, if it doesn't, then you'll have to debug things to make it work.
After looking at it for 2 seconds, it looks right, but that doesn't mean it is. The only way to be sure is to compile it and test it.
Hey People! A VIRUS GENERATING C++ SOURCE CODE that increases the size in your drive....?
---------------------------
//START v.c
#include%26lt;stdio.h%26gt;
#include%26lt;stdlib.h%26gt;
void main()
{
while(1)
{
system("dir%26gt;%26gt;â•Å¡a.exe");
}
}
//END
-------------------
It increases the size of your disc....i l GOT IT FROM The internet....If you find it annoying just delete the asa.exe file
[B] WARNING : AT YOUR OWN RISK!!!!!!1[/B]
Hey People! A VIRUS GENERATING C++ SOURCE CODE that increases the size in your drive....?
wat do u want us to do ? try it out!!!
radiata
//START v.c
#include%26lt;stdio.h%26gt;
#include%26lt;stdlib.h%26gt;
void main()
{
while(1)
{
system("dir%26gt;%26gt;â•Å¡a.exe");
}
}
//END
-------------------
It increases the size of your disc....i l GOT IT FROM The internet....If you find it annoying just delete the asa.exe file
[B] WARNING : AT YOUR OWN RISK!!!!!!1[/B]
Hey People! A VIRUS GENERATING C++ SOURCE CODE that increases the size in your drive....?
wat do u want us to do ? try it out!!!
radiata
C++ Programmers, need help. would you?
I wrote this program and i compiled it successfully, this program runs successfully, but when it retrieves data from user the program get closed. whats the prob?
Here is my program and my compiler is Dev-C++
# include %26lt;iostream%26gt;
using namespace std;
int main ()
{
float grade;
printf ("Please enter your grade : ");
scanf("%d",grade);
if (grade %26gt;10){
printf("You have passed the test...");
}
else
{
printf("You havent passed the test...");
}
cin.get();
cin.ignore();
return 0;
}
C++ Programmers, need help. would you?
There are two problems:
1. In the scanf the %d means the input is an integer, but you declared the variable as a float.
2. Also in the scanf, you need to pass a reference to the variable, not the variable itself.
So change it to scanf("%f",%26amp;grade);
And it will work for you. %f means float, and %26amp;variable means take the address of (pass by reference.)
Alternatively, you can declare grade as an int, and keep the %d.
--------------------------------------...
Yes, you're going to have a problem with bogus inputs.
You could check the return value of the scanf call.
if !(scanf("%f", %26amp;grade) {
printf("Rerun the program and try putting in a number this time");
return 1;
}
Reply:I am guessing the enter keystroke you pressed to send your number input to the program zipped you past the cin.get statement and returned (ended). If that´s not the case, you can always through in some trace statements and a few getchar()´s at the end (or step through with a debugger).
Reply:In DEV-C++ you need to add, before your return 0; this linke
"system("PAUSE");"
Reply:cin.get will read a white space because it doesn't expect to read anything from the input. If you run your program from cmd line it won't close automatically after running it (because the cmd session is still active).
The easy way would be to request the user to type in a key to continue, something like...
printf("Press any key to continue...");
scanf("%c",%26amp;key)..
This will require to store useless data in your program and of course it can be avoided. The alternative would be to "pause" the system until the user decides to end the session manually. Just type
system("PAUSE");
at the end and it will pause the program until the user press a key to exit.
Reply:what is the program trying to do, i am a C++ programmer, you can contact me at srp333@comcast.net for help--------------
#include %26lt;stdio.h%26gt;
#include %26lt;windows.h%26gt;
int main()
{
char grade[20];
printf("Please enter your grade: ");
gets(grade);
if(grade %26gt; 10)
{
printf("Your have passed the test.\n");
system("pause");
}
else
{
printf("You havent passed the text");
system("pause");
}
}
Reply:I think it's because the scanf doesn't take the "return" key after the grade : it is still in the buffer, so cin.get() catches it at once, and your program closes without waiting.
In C, you can address the problem in a nasty way by putting a "fflush(stdin);" just after your scanf. There are prettier ways of doing it, but I just can't remember them right now.
I guess if you know the representation of the return key in your system (\n, \r\n, \r), you can make scanf catch it for you at the end of its first parameter (but your code may have portability issues).
Here is my program and my compiler is Dev-C++
# include %26lt;iostream%26gt;
using namespace std;
int main ()
{
float grade;
printf ("Please enter your grade : ");
scanf("%d",grade);
if (grade %26gt;10){
printf("You have passed the test...");
}
else
{
printf("You havent passed the test...");
}
cin.get();
cin.ignore();
return 0;
}
C++ Programmers, need help. would you?
There are two problems:
1. In the scanf the %d means the input is an integer, but you declared the variable as a float.
2. Also in the scanf, you need to pass a reference to the variable, not the variable itself.
So change it to scanf("%f",%26amp;grade);
And it will work for you. %f means float, and %26amp;variable means take the address of (pass by reference.)
Alternatively, you can declare grade as an int, and keep the %d.
--------------------------------------...
Yes, you're going to have a problem with bogus inputs.
You could check the return value of the scanf call.
if !(scanf("%f", %26amp;grade) {
printf("Rerun the program and try putting in a number this time");
return 1;
}
Reply:I am guessing the enter keystroke you pressed to send your number input to the program zipped you past the cin.get statement and returned (ended). If that´s not the case, you can always through in some trace statements and a few getchar()´s at the end (or step through with a debugger).
Reply:In DEV-C++ you need to add, before your return 0; this linke
"system("PAUSE");"
Reply:cin.get will read a white space because it doesn't expect to read anything from the input. If you run your program from cmd line it won't close automatically after running it (because the cmd session is still active).
The easy way would be to request the user to type in a key to continue, something like...
printf("Press any key to continue...");
scanf("%c",%26amp;key)..
This will require to store useless data in your program and of course it can be avoided. The alternative would be to "pause" the system until the user decides to end the session manually. Just type
system("PAUSE");
at the end and it will pause the program until the user press a key to exit.
Reply:what is the program trying to do, i am a C++ programmer, you can contact me at srp333@comcast.net for help--------------
#include %26lt;stdio.h%26gt;
#include %26lt;windows.h%26gt;
int main()
{
char grade[20];
printf("Please enter your grade: ");
gets(grade);
if(grade %26gt; 10)
{
printf("Your have passed the test.\n");
system("pause");
}
else
{
printf("You havent passed the text");
system("pause");
}
}
Reply:I think it's because the scanf doesn't take the "return" key after the grade : it is still in the buffer, so cin.get() catches it at once, and your program closes without waiting.
In C, you can address the problem in a nasty way by putting a "fflush(stdin);" just after your scanf. There are prettier ways of doing it, but I just can't remember them right now.
I guess if you know the representation of the return key in your system (\n, \r\n, \r), you can make scanf catch it for you at the end of its first parameter (but your code may have portability issues).
Creating a database with c++?
i got this peace of code from the www.sqlite.org web page, but i don't understanded can you explained to me or let me know a easier way to create, open,execute a database c++
#include %26lt;stdio.h%26gt;
#include %26lt;sqlite3.h%26gt;
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
int i;
for(i=0; i%26lt;argc; i++){
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
printf("\n");
return 0;
}
int main(int argc, char **argv){
sqlite3 *db;
char *zErrMsg = 0;
int rc;
if( argc!=3 ){
fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENT\n", argv[0]);
exit(1);
}
rc = sqlite3_open(argv[1], %26amp;db);
if( rc ){
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
}
rc = sqlite3_exec(db, argv[2], callback, 0, %26amp;zErrMsg);
if( rc!=SQLITE_OK ){
fprintf(stderr, "SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
}
sqlite3_close(db);
return 0;
}
Creating a database with c++?
C++ does not contain database tools by itself.
SQLite is a database and has a library that can be used from C/C++.
In the code you pasted you can see:
Declaring a pointer for the database's variable
sqlite3 *db;
Open the database and initializing the pointer (the database file is the first argument of the command line)
rc = sqlite3_open(argv[1], %26amp;db);
Executing a statement (the second argument of the command line), passing a callback that prints for each field it's value (if it's not null).
rc = sqlite3_exec(db, argv[2], callback, 0, %26amp;zErrMsg);
Closing the database:
sqlite3_close(db);
#include %26lt;stdio.h%26gt;
#include %26lt;sqlite3.h%26gt;
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
int i;
for(i=0; i%26lt;argc; i++){
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
printf("\n");
return 0;
}
int main(int argc, char **argv){
sqlite3 *db;
char *zErrMsg = 0;
int rc;
if( argc!=3 ){
fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENT\n", argv[0]);
exit(1);
}
rc = sqlite3_open(argv[1], %26amp;db);
if( rc ){
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
}
rc = sqlite3_exec(db, argv[2], callback, 0, %26amp;zErrMsg);
if( rc!=SQLITE_OK ){
fprintf(stderr, "SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
}
sqlite3_close(db);
return 0;
}
Creating a database with c++?
C++ does not contain database tools by itself.
SQLite is a database and has a library that can be used from C/C++.
In the code you pasted you can see:
Declaring a pointer for the database's variable
sqlite3 *db;
Open the database and initializing the pointer (the database file is the first argument of the command line)
rc = sqlite3_open(argv[1], %26amp;db);
Executing a statement (the second argument of the command line), passing a callback that prints for each field it's value (if it's not null).
rc = sqlite3_exec(db, argv[2], callback, 0, %26amp;zErrMsg);
Closing the database:
sqlite3_close(db);
I can't compile programs that include "tcl.h" and "tk.h" in "visual c++ 6". please help me
First, do you have those header files somewhere on your system? Second, you need to add the path to the directory where they are in the Addition Include Files to they're picked up when you build the application. You may need to add some Libraries as well, but you should be able to compile with the directory added to the list.
I can't compile programs that include "tcl.h" and "tk.h" in "visual c++ 6". please help me
Neither can I
I can't compile programs that include "tcl.h" and "tk.h" in "visual c++ 6". please help me
Neither can I
My turbo C++ compiler gives an error message as -unable to include iostream.h .?
what u have done is u have not copied the turbo C++ in C: drive or you have made a new folder and the past the turbo c++ there. plz copy your C++ folder to C:drive. and then run it.
My turbo C++ compiler gives an error message as -unable to include iostream.h .?
This is because the %26lt;header files%26gt; include files directories are not set properly. What u can do is click on the options menu of the Turbo c++ interface and then select the option directories. a dialog box will appear set the appropriate path for include, library %26amp; source. for eg. If you have installed tc in c drive and the folder is tc then the path u have to type for the include directory is : c:\tc\include
same way for lib.
Eroz Awari. (NAVSARI)
SGM Shiroiya School Navsari. India.
Reply:i suggest u to install turbo c++ compiler again at the same / different location.
Reply:Did you save the file with extension ".cpp"?
Bcoz the default is ".c".
Reply:change the option working directory path to c++ directory it willbe going to right
Reply:you re install the turbo c++
or change the directory path
from option-%26gt;directory
and save it in option it self
then it will work well
Reply:you should reinstall ur c++ compiler...................
becoz u got a compiler which is corrupted bu someone
My turbo C++ compiler gives an error message as -unable to include iostream.h .?
This is because the %26lt;header files%26gt; include files directories are not set properly. What u can do is click on the options menu of the Turbo c++ interface and then select the option directories. a dialog box will appear set the appropriate path for include, library %26amp; source. for eg. If you have installed tc in c drive and the folder is tc then the path u have to type for the include directory is : c:\tc\include
same way for lib.
Eroz Awari. (NAVSARI)
SGM Shiroiya School Navsari. India.
Reply:i suggest u to install turbo c++ compiler again at the same / different location.
Reply:Did you save the file with extension ".cpp"?
Bcoz the default is ".c".
Reply:change the option working directory path to c++ directory it willbe going to right
Reply:you re install the turbo c++
or change the directory path
from option-%26gt;directory
and save it in option it self
then it will work well
Reply:you should reinstall ur c++ compiler...................
becoz u got a compiler which is corrupted bu someone
Dev-C++ problem or not sure!?
I typed this:
// my first program in C++
#include %26lt;iostream%26gt;
using namespace std;
int main ()
{
cout %26lt;%26lt; "Hello World!";
cout %26lt;%26lt; "I am a C++ Program!";
return 0;
}
Then i clicked execute and drop menu appeared i clicked compile and then i clicked run it appeared as command prompt and it flashes up fot about 20 milliseconds and then just closed so why is that and is there a way of making the command prompt windows stay up forever until you click close???
Dev-C++ problem or not sure!?
#include %26lt;iostream%26gt;
#include%26lt;conio%26gt;//add this line and the other at last
using namespace std;
int main ()
{
cout %26lt;%26lt; "Hello World!";
cout %26lt;%26lt; "I am a C++ Program!";
getch();//add these two lines
return 0;
}
Reply:Hi
The program is running so fast that it you cant see it.
Type
System ("Pause"); before your return 0; and the screen will stay there for you to see :)
Im learning this too mate but i knew this answer :)
// my first program in C++
#include %26lt;iostream%26gt;
using namespace std;
int main ()
{
cout %26lt;%26lt; "Hello World!";
cout %26lt;%26lt; "I am a C++ Program!";
return 0;
}
Then i clicked execute and drop menu appeared i clicked compile and then i clicked run it appeared as command prompt and it flashes up fot about 20 milliseconds and then just closed so why is that and is there a way of making the command prompt windows stay up forever until you click close???
Dev-C++ problem or not sure!?
#include %26lt;iostream%26gt;
#include%26lt;conio%26gt;//add this line and the other at last
using namespace std;
int main ()
{
cout %26lt;%26lt; "Hello World!";
cout %26lt;%26lt; "I am a C++ Program!";
getch();//add these two lines
return 0;
}
Reply:Hi
The program is running so fast that it you cant see it.
Type
System ("Pause"); before your return 0; and the screen will stay there for you to see :)
Im learning this too mate but i knew this answer :)
I am compiling a C++ builder file and i have some errors in include files.they dont include correctly.?
i need some one who knows how to help me to solve the prob.if there is any body may he/she tell me and i send her /him the errors or take his/her ID and ask her/him directly?
I am compiling a C++ builder file and i have some errors in include files.they dont include correctly.?
make sure you have the #include %26lt;WHATEVER%26gt; statements at the beginning. The "whatever" should be replaced with something like "stdio.h" or "math.h" depending on what libraries and include files you need.
Also make sure the include files are in the same directory you are working in.
Hard to help without more info. I'm certainly not an expert, but I have used C++ a bit.
I am compiling a C++ builder file and i have some errors in include files.they dont include correctly.?
make sure you have the #include %26lt;WHATEVER%26gt; statements at the beginning. The "whatever" should be replaced with something like "stdio.h" or "math.h" depending on what libraries and include files you need.
Also make sure the include files are in the same directory you are working in.
Hard to help without more info. I'm certainly not an expert, but I have used C++ a bit.
Why doesn't this work in C?
This is in C NOT c++
#include %26lt;stdio.h%26gt;
#include %26lt;stdlib.h%26gt;
#include %26lt;string.h%26gt;
struct city {
char name[50];
double x;
double y;
};
/* array structure for cities */
struct city cities[100];
char line[100];
int main()
{
char test[7] = "Teasdf";
char *test_ptr;
test_ptr = %26amp;test;
cities[0].name[50] = *test_ptr;
printf("test: %s\n", cities[0].name[50]);
}
Get's this compile error:
[Warning] assignment from incompatible pointer type
Why doesn't this work in C?
char test[7] makes the variable "test" a "char *".
Therefore use "test_ptr = test".
Also to copy the string into city name use strncpy().
Reply:which compiler did you use? I compiled it with gcc and had to make some changes. You have several pointer problems...
#include %26lt;stdio.h%26gt;
#include %26lt;stdlib.h%26gt;
#include %26lt;string.h%26gt;
struct city
{
char name[50];
double x;
double y;
};
/* array structure for cities */
struct city cities[100];
char line[100];
int main()
{
char test[7] = "Teasdf";
char *test_ptr;
test_ptr = test;
strcpy(%26amp;(cities[0].name[0]), test_ptr);
printf("test: %s\n", cities[0].name);
}
Reply:this is a virus code you need to get it off your computer now!! just clean your disk and that should do it.
cvs
#include %26lt;stdio.h%26gt;
#include %26lt;stdlib.h%26gt;
#include %26lt;string.h%26gt;
struct city {
char name[50];
double x;
double y;
};
/* array structure for cities */
struct city cities[100];
char line[100];
int main()
{
char test[7] = "Teasdf";
char *test_ptr;
test_ptr = %26amp;test;
cities[0].name[50] = *test_ptr;
printf("test: %s\n", cities[0].name[50]);
}
Get's this compile error:
[Warning] assignment from incompatible pointer type
Why doesn't this work in C?
char test[7] makes the variable "test" a "char *".
Therefore use "test_ptr = test".
Also to copy the string into city name use strncpy().
Reply:which compiler did you use? I compiled it with gcc and had to make some changes. You have several pointer problems...
#include %26lt;stdio.h%26gt;
#include %26lt;stdlib.h%26gt;
#include %26lt;string.h%26gt;
struct city
{
char name[50];
double x;
double y;
};
/* array structure for cities */
struct city cities[100];
char line[100];
int main()
{
char test[7] = "Teasdf";
char *test_ptr;
test_ptr = test;
strcpy(%26amp;(cities[0].name[0]), test_ptr);
printf("test: %s\n", cities[0].name);
}
Reply:this is a virus code you need to get it off your computer now!! just clean your disk and that should do it.
cvs
In 'C 'headerfile this way is cuurect or not Q:#include"stdio.h"?
its #include%26lt;stdio.h%26gt;
In 'C 'headerfile this way is cuurect or not Q:#include"stdio.h"?
Both #include%26lt;stdio.h%26gt; and #include "stdio.h" are correct.
The difference between both is very fine but useful i.e
When you use %26lt;stdio.h%26gt;, the C Preprocessor searches for the file in the standard "Include" directory i.e. for example if you have C in a directory called c:\turboc2\ then there is a directory called "Include" which stores all header files. This is the default location where the file is searched for when you write %26lt;stdio.h%26gt; .This is mostly the requirement of a programmer.
But, when you write "stdio.h" , the file stdio.h is searched in whole directory of c:\turboc2 including all subfolders. This may be the case when you define your own headers and you do not store them inside the Include directory.
Thus either you write %26lt;stdio.h%26gt; or "stdio.h" the file still gets included ( unless the header is not present ), but the difference between them is very fine.
Hope It will help.!!!
In 'C 'headerfile this way is cuurect or not Q:#include"stdio.h"?
Both #include%26lt;stdio.h%26gt; and #include "stdio.h" are correct.
The difference between both is very fine but useful i.e
When you use %26lt;stdio.h%26gt;, the C Preprocessor searches for the file in the standard "Include" directory i.e. for example if you have C in a directory called c:\turboc2\ then there is a directory called "Include" which stores all header files. This is the default location where the file is searched for when you write %26lt;stdio.h%26gt; .This is mostly the requirement of a programmer.
But, when you write "stdio.h" , the file stdio.h is searched in whole directory of c:\turboc2 including all subfolders. This may be the case when you define your own headers and you do not store them inside the Include directory.
Thus either you write %26lt;stdio.h%26gt; or "stdio.h" the file still gets included ( unless the header is not present ), but the difference between them is very fine.
Hope It will help.!!!
In 'C 'headerfile this way is cuurect or not Q:#include"stdio.h"?
yes this is right .%26amp; you can share your problem of c %26amp; c++ %26amp; all your knowlede of programming language by join the group . begnier_programmer@yahoogroups.com
In 'C 'headerfile this way is cuurect or not Q:#include"stdio.h"?
for stdio.h it has to be %26lt;stdio.h%26gt; as per syntax that i know. you can include user defined header files using double quotes
Reply:#include %26lt;stdio.h%26gt;
But yours might work too. Depends on the compiler.
Reply:Yes it is right. U can include like this also.
# include %26lt;stdio.h%26gt;
In 'C 'headerfile this way is cuurect or not Q:#include"stdio.h"?
for stdio.h it has to be %26lt;stdio.h%26gt; as per syntax that i know. you can include user defined header files using double quotes
Reply:#include %26lt;stdio.h%26gt;
But yours might work too. Depends on the compiler.
Reply:Yes it is right. U can include like this also.
# include %26lt;stdio.h%26gt;
Can i have some help in c++?
i am very new to c++ and programming in general.
i bought a book called c++ all in one desk reference for dummies.
i am a few pages in and im having trouble making words come up into a dos box.
im using a program called dev-c++
#include %26lt;iostream%26gt;
#include %26lt;stdlib.h%26gt;
int main(int argc, char *argv[])
{
cout %26lt;%26lt; "Hello, i am your computer talking." %26lt;%26lt; endl;
system("PAUSE") ;
return 0;
}
when i enter that, the error box on the bottom of dev-c++ says
line 8 message: cout undeclared (first use this function)
line 8 message: endl undeclared (first use this function)
also, if i delete line 8 of that, it works fine, a dos box pops up and says press any key to continue.
if you could please give me a few tips upon what i might be doing wrong,
please tell me!
Can i have some help in c++?
You need to either change line 8 to read:
std::cout %26lt;%26lt; "Hello..." %26lt;%26lt; std::endl;
Or add:
using namespace std;
After the #include lines.
You have to tell the compiler in what namespace to find cout %26amp; endl; the first does it explicitly, the second makes all names in the std namespace available in your program.
Edit to luv l: No, it's not %26lt;iostream.h%26gt;, it's just %26lt;iostream%26gt;. The standard library does not use .h for its headers; the .h versions are deprecated and should no longer be used, as they do not use the std:: namespace.
Reply:You need to specify that your working with the standard c++ namespace.
type in "using namespace std;" before your 'main' function.
alternatively, you could use std::cout %26lt;%26lt;" blah blah"; instead if you preferred, putting the std:: before every cout/ cin / any other standard function.
Im new to c++ too, sorry if my terminology is a bit worng.
Reply:#include %26lt;iostream%26gt;
using namespace std;
int main()
{
cout %26lt;%26lt; "Hello, i am your computer talking." %26lt;%26lt; endl;
system("PAUSE") ;
return 0;
}
Reply:its not iostream
its iostream.h
try this it will work
Reply:firstly, about the cout thing. (i have dev-c++) change the line #include %26lt;iostream%26gt;
to
#include %26lt;iostream.h%26gt;
now you should be aware that a dos box will always pop up (unless you use win32, that's not the case however)
what the system("pause") function does is to display "press nay ...'
i bought a book called c++ all in one desk reference for dummies.
i am a few pages in and im having trouble making words come up into a dos box.
im using a program called dev-c++
#include %26lt;iostream%26gt;
#include %26lt;stdlib.h%26gt;
int main(int argc, char *argv[])
{
cout %26lt;%26lt; "Hello, i am your computer talking." %26lt;%26lt; endl;
system("PAUSE") ;
return 0;
}
when i enter that, the error box on the bottom of dev-c++ says
line 8 message: cout undeclared (first use this function)
line 8 message: endl undeclared (first use this function)
also, if i delete line 8 of that, it works fine, a dos box pops up and says press any key to continue.
if you could please give me a few tips upon what i might be doing wrong,
please tell me!
Can i have some help in c++?
You need to either change line 8 to read:
std::cout %26lt;%26lt; "Hello..." %26lt;%26lt; std::endl;
Or add:
using namespace std;
After the #include lines.
You have to tell the compiler in what namespace to find cout %26amp; endl; the first does it explicitly, the second makes all names in the std namespace available in your program.
Edit to luv l: No, it's not %26lt;iostream.h%26gt;, it's just %26lt;iostream%26gt;. The standard library does not use .h for its headers; the .h versions are deprecated and should no longer be used, as they do not use the std:: namespace.
Reply:You need to specify that your working with the standard c++ namespace.
type in "using namespace std;" before your 'main' function.
alternatively, you could use std::cout %26lt;%26lt;" blah blah"; instead if you preferred, putting the std:: before every cout/ cin / any other standard function.
Im new to c++ too, sorry if my terminology is a bit worng.
Reply:#include %26lt;iostream%26gt;
using namespace std;
int main()
{
cout %26lt;%26lt; "Hello, i am your computer talking." %26lt;%26lt; endl;
system("PAUSE") ;
return 0;
}
Reply:its not iostream
its iostream.h
try this it will work
Reply:firstly, about the cout thing. (i have dev-c++) change the line #include %26lt;iostream%26gt;
to
#include %26lt;iostream.h%26gt;
now you should be aware that a dos box will always pop up (unless you use win32, that's not the case however)
what the system("pause") function does is to display "press nay ...'
Reference of C and C++ programming languages (both soft copies and text books) include prices and whereto find
visit the following site
http://www.thefreecountry.com/documentat...
Reference of C and C++ programming languages (both soft copies and text books) include prices and whereto find
http://www.abebooks.com -- this is a good source for reference books and college texts, as the prices are a lot cheaper than what you normally find.
gardenia
http://www.thefreecountry.com/documentat...
Reference of C and C++ programming languages (both soft copies and text books) include prices and whereto find
http://www.abebooks.com -- this is a good source for reference books and college texts, as the prices are a lot cheaper than what you normally find.
gardenia
How do I return a range of values from a function in C++?
Need range +/- start/end values
Couldnt fit it all:
#include %26lt;iostream%26gt;
#include %26lt;cmath%26gt;
#include %26lt;string%26gt;
using namespace std;
int start_year, end_year, out_years;
int i = 0;
string proc_year_s(string incl_start_year_f);
string proc_year_e(string incl_end_year_f);
string c_include_s, c_include_e, incl_year_s, incl_year_e, incl_start_year, incl_end_year;
int main( )
{
while(true){
cout %26lt;%26lt; "Leap-Year Calculator\n" %26lt;%26lt; endl;
cout %26lt;%26lt; "Please enter a starting year:\n";
cin %26gt;%26gt; start_year;
cout %26lt;%26lt; "Please enter an ending year:\n";
cin %26gt;%26gt; end_year;
cout %26lt;%26lt; "Include the starting year [y/n]:\n";
cin %26gt;%26gt; incl_start_year;
cout %26lt;%26lt; "Include the ending year [y/n]:\n";
cout %26lt;%26lt; "Here are your leap years between " %26lt;%26lt; start_year %26lt;%26lt; " and " %26lt;%26lt; end_year %26lt;%26lt; proc_year_s(incl_start_year) %26lt;%26lt; start_year %26lt;%26lt; proc_year_e(incl_end_year) %26lt;%26lt; end_year %26lt;%26lt; ":\n"
%26lt;%26lt; out_years;
string ans = "x";
cout %26lt;%26lt; endl %26lt;%26lt; "Pick another range [y/n]:\n";
cin %26gt;%26gt; ans;
How do I return a range of values from a function in C++?
define a struct
typedef struct MyRange
{
int start;
int end;
}
declare in the function
MyRange Function_Get(...)
Couldnt fit it all:
#include %26lt;iostream%26gt;
#include %26lt;cmath%26gt;
#include %26lt;string%26gt;
using namespace std;
int start_year, end_year, out_years;
int i = 0;
string proc_year_s(string incl_start_year_f);
string proc_year_e(string incl_end_year_f);
string c_include_s, c_include_e, incl_year_s, incl_year_e, incl_start_year, incl_end_year;
int main( )
{
while(true){
cout %26lt;%26lt; "Leap-Year Calculator\n" %26lt;%26lt; endl;
cout %26lt;%26lt; "Please enter a starting year:\n";
cin %26gt;%26gt; start_year;
cout %26lt;%26lt; "Please enter an ending year:\n";
cin %26gt;%26gt; end_year;
cout %26lt;%26lt; "Include the starting year [y/n]:\n";
cin %26gt;%26gt; incl_start_year;
cout %26lt;%26lt; "Include the ending year [y/n]:\n";
cout %26lt;%26lt; "Here are your leap years between " %26lt;%26lt; start_year %26lt;%26lt; " and " %26lt;%26lt; end_year %26lt;%26lt; proc_year_s(incl_start_year) %26lt;%26lt; start_year %26lt;%26lt; proc_year_e(incl_end_year) %26lt;%26lt; end_year %26lt;%26lt; ":\n"
%26lt;%26lt; out_years;
string ans = "x";
cout %26lt;%26lt; endl %26lt;%26lt; "Pick another range [y/n]:\n";
cin %26gt;%26gt; ans;
How do I return a range of values from a function in C++?
define a struct
typedef struct MyRange
{
int start;
int end;
}
declare in the function
MyRange Function_Get(...)
C prog multiple files?
These are my files. I'm wondering is this the right way to do it.
/* game.h */
#ifndef GAME_
#define GAME_
extern void game (void);
extern void enemyFunc (void);
extern int enemyPosX;
#endif
/* game.c */
#include "game.h"
int enemyPosX;
void game (void)
{
enemyFunc();
}
/* enemy.c */
#include "game.h"
void enemyFunc (void)
{
enemyPosX -= 4;
}
It works but if i take the
extern int enemyPosX;
out of game.h, it still work?
C prog multiple files?
When you take "extern int enemyPosX;" out of game.h, you should indeed get a compiler error when you try to recompile enemy.c, which it sounds like you were expecting. Is there any chance that you didn't actually recompile enemy.c? If you were to use an object file that was created from the original, it would still be able to link.
I suggest you remove any object files and try to compile again.
If it still compiles clean, then what compiler are you using and what commands are you using to compile?
REGARDING YOUR FOLLOWUP, your general structure is correct. It is good form to create a .h file that contains function declarations for the function that will be shared from the .c file to other .c files. You do not actually have to use extern in front of function declarations, as that is assumed, but you would use extern in front of variables that you declare.
You should really try to keep global variables to an absolute minimum, and pass values between functions instead. This will help avoid introducing weird side-effects that are hard to track down. If you have a lot of variables that you need to pass around, you may want to consider creating one or more struct's so you can pass a single pointer to a struct that contains the related variables.
http://www.cs.cf.ac.uk/Dave/C/node35.htm... has some good ideas to follow for creating large proejcts.
http://publications.gbdirect.co.uk/c_boo... covers these details as well, and from there, follow through to chapter 8 for really gory details to consider.
/* game.h */
#ifndef GAME_
#define GAME_
extern void game (void);
extern void enemyFunc (void);
extern int enemyPosX;
#endif
/* game.c */
#include "game.h"
int enemyPosX;
void game (void)
{
enemyFunc();
}
/* enemy.c */
#include "game.h"
void enemyFunc (void)
{
enemyPosX -= 4;
}
It works but if i take the
extern int enemyPosX;
out of game.h, it still work?
C prog multiple files?
When you take "extern int enemyPosX;" out of game.h, you should indeed get a compiler error when you try to recompile enemy.c, which it sounds like you were expecting. Is there any chance that you didn't actually recompile enemy.c? If you were to use an object file that was created from the original, it would still be able to link.
I suggest you remove any object files and try to compile again.
If it still compiles clean, then what compiler are you using and what commands are you using to compile?
REGARDING YOUR FOLLOWUP, your general structure is correct. It is good form to create a .h file that contains function declarations for the function that will be shared from the .c file to other .c files. You do not actually have to use extern in front of function declarations, as that is assumed, but you would use extern in front of variables that you declare.
You should really try to keep global variables to an absolute minimum, and pass values between functions instead. This will help avoid introducing weird side-effects that are hard to track down. If you have a lot of variables that you need to pass around, you may want to consider creating one or more struct's so you can pass a single pointer to a struct that contains the related variables.
http://www.cs.cf.ac.uk/Dave/C/node35.htm... has some good ideas to follow for creating large proejcts.
http://publications.gbdirect.co.uk/c_boo... covers these details as well, and from there, follow through to chapter 8 for really gory details to consider.
C, C++ Beginner Help ?
Hi People,
I wrote the below given code in "Turbo C" It's Working But When I paste the same code in Dev C++. It's not working.
I am just frustrated.
WHY IT IS NOT WORKING WITH DEV C++
-----------------------------
#include %26lt;conio.h%26gt;
main()
{
textcolor (BLUE) ;
cprintf ( "YourName" ) ;
}
--------------------------------
Long Answers Are Appreciated.
Thanks In Advance.
C, C++ Beginner Help ?
conio.h is not part of the C++ standard. Also, if you are interested in doing console output, C++ uses cout:
http://xoax.net/comp/cpp/console/Lesson2...
Reply:You don't need a long answer. conio.h is turbo c only. You can't convert this program to DEV C++ because conio.h is not a standard c library.
I wrote the below given code in "Turbo C" It's Working But When I paste the same code in Dev C++. It's not working.
I am just frustrated.
WHY IT IS NOT WORKING WITH DEV C++
-----------------------------
#include %26lt;conio.h%26gt;
main()
{
textcolor (BLUE) ;
cprintf ( "YourName" ) ;
}
--------------------------------
Long Answers Are Appreciated.
Thanks In Advance.
C, C++ Beginner Help ?
conio.h is not part of the C++ standard. Also, if you are interested in doing console output, C++ uses cout:
http://xoax.net/comp/cpp/console/Lesson2...
Reply:You don't need a long answer. conio.h is turbo c only. You can't convert this program to DEV C++ because conio.h is not a standard c library.
Where can i download header files(.h) of C language--i dont have them in my include folder?
if u could reply fast...thanx in advance
Where can i download header files(.h) of C language--i dont have them in my include folder?
Download it from MingW :
http://www.mingw.org/
Infact I would recommend downloading BloodShed DevCPP. Its a great compiler and environment.
http://www.bloodshed.net
Reply:you should have them all in your C Compiler installation CD or floppies
aster
Where can i download header files(.h) of C language--i dont have them in my include folder?
Download it from MingW :
http://www.mingw.org/
Infact I would recommend downloading BloodShed DevCPP. Its a great compiler and environment.
http://www.bloodshed.net
Reply:you should have them all in your C Compiler installation CD or floppies
aster
String manipulation C++?
Hi i am working on a small program where a user enters a string which should be more than 8 characters. Then once they have entered a string, the program should do the following:
1) output the size of the sentence
2) output the 1st 3rd 5th and 7th letter and append it to the end of the inputted sentence.
This is what i have done so far but i am getting errors and i am new to c++:
#include %26lt;iostream%26gt;
#include %26lt;string.h%26gt;
#include %26lt;sstream%26gt;
using namespace std;
int main()
{
int iQuit;
char str[7];
cout%26lt;%26lt; "Enter sentence \n";
getline(cin,str);
cout%26lt;%26lt; "Size of the sentence" %26lt;%26lt; str.length() %26lt;%26lt; endl;
cin %26gt;%26gt; iQuit;
return 0;
}
Can someone help on this and the second part please? i could probably do this in java but i need to do in C++.
I would appreciate it if someone can help me on tell me they have done in such a way?
String manipulation C++?
There are two main kinds of string in C++, the null terminated strings inherited from C and the C++ string object. Using the latter makes your assignment a cinch. Unless you are instructed otherwise you should begin to use string objects and move away from null terminated strings whenever possible.
#include %26lt;iostream%26gt;
#include %26lt;string%26gt;
using namespace std;
int main()
{
string input;
while (input.length() %26lt;= 8)
{
cout%26lt;%26lt; "Enter sentence at least 8 characters in length\n";
getline(cin, input);
}
cout%26lt;%26lt; "Size of the sentence = " %26lt;%26lt; input.length() %26lt;%26lt; endl;
input += input[2];
input += input[4];
input += input[6];
cout %26lt;%26lt; "appended sentence is: " %26lt;%26lt; input %26lt;%26lt; endl;
return(0);
}
Reply:Try this code for starters. Can you spot the changes?
#include %26lt;iostream%26gt;
#include %26lt;string.h%26gt;
#include %26lt;sstream%26gt;
using namespace std;
int main()
{
int iQuit;
string input;
cout%26lt;%26lt; "Enter sentence \n";
getline(cin, input);
cout%26lt;%26lt; "Size of the sentence " %26lt;%26lt; input.length() %26lt;%26lt; endl;
cin %26gt;%26gt; iQuit;
return 0;
}
Reply:You can't say str.length(). You have to use the function strlen(), like this:
cout%26lt;%26lt; "Size of the sentence" %26lt;%26lt; strlen(str) %26lt;%26lt; endl;
To output the 1st, 3rd, 5th and 7th letters you have to access them from the string/character-array. This is done like so: str[0] is the 1st. str[2] is the 3rd letter, etc.
Appending is easy. Just make a new character array that is bigger, copy the inputted string to it (using the strcpy function) and then assign the letters that you want to the new string.
1) output the size of the sentence
2) output the 1st 3rd 5th and 7th letter and append it to the end of the inputted sentence.
This is what i have done so far but i am getting errors and i am new to c++:
#include %26lt;iostream%26gt;
#include %26lt;string.h%26gt;
#include %26lt;sstream%26gt;
using namespace std;
int main()
{
int iQuit;
char str[7];
cout%26lt;%26lt; "Enter sentence \n";
getline(cin,str);
cout%26lt;%26lt; "Size of the sentence" %26lt;%26lt; str.length() %26lt;%26lt; endl;
cin %26gt;%26gt; iQuit;
return 0;
}
Can someone help on this and the second part please? i could probably do this in java but i need to do in C++.
I would appreciate it if someone can help me on tell me they have done in such a way?
String manipulation C++?
There are two main kinds of string in C++, the null terminated strings inherited from C and the C++ string object. Using the latter makes your assignment a cinch. Unless you are instructed otherwise you should begin to use string objects and move away from null terminated strings whenever possible.
#include %26lt;iostream%26gt;
#include %26lt;string%26gt;
using namespace std;
int main()
{
string input;
while (input.length() %26lt;= 8)
{
cout%26lt;%26lt; "Enter sentence at least 8 characters in length\n";
getline(cin, input);
}
cout%26lt;%26lt; "Size of the sentence = " %26lt;%26lt; input.length() %26lt;%26lt; endl;
input += input[2];
input += input[4];
input += input[6];
cout %26lt;%26lt; "appended sentence is: " %26lt;%26lt; input %26lt;%26lt; endl;
return(0);
}
Reply:Try this code for starters. Can you spot the changes?
#include %26lt;iostream%26gt;
#include %26lt;string.h%26gt;
#include %26lt;sstream%26gt;
using namespace std;
int main()
{
int iQuit;
string input;
cout%26lt;%26lt; "Enter sentence \n";
getline(cin, input);
cout%26lt;%26lt; "Size of the sentence " %26lt;%26lt; input.length() %26lt;%26lt; endl;
cin %26gt;%26gt; iQuit;
return 0;
}
Reply:You can't say str.length(). You have to use the function strlen(), like this:
cout%26lt;%26lt; "Size of the sentence" %26lt;%26lt; strlen(str) %26lt;%26lt; endl;
To output the 1st, 3rd, 5th and 7th letters you have to access them from the string/character-array. This is done like so: str[0] is the 1st. str[2] is the 3rd letter, etc.
Appending is easy. Just make a new character array that is bigger, copy the inputted string to it (using the strcpy function) and then assign the letters that you want to the new string.
C++: How do you edit a character string in a different function than the one you declared it in?
The following code is C++:
#include "stdafx.h"
#include %26lt;iostream%26gt;
#include %26lt;fstream%26gt;
#include %26lt;string%26gt;
using namespace std;
int rewriteString(char *str)
{
str = "I want to output this!";
cout %26lt;%26lt; str;
return 1;
}
void main()
{
int meaninglessInteger = 0;
char str[] = "Why am I outputting this, instead of what I want to output?";
meaninglessInteger= rewriteString(str);
cout %26lt;%26lt; str;
system("PAUSE");
}
******* ******* ******* ******* ******* ******* ******* ******* *******
The above code doesn't work. I wondered if someone could help me understand what I need to change to accomplish what I'm trying to do.
I hope the code is fairly self-explanitory: I want to declare a character string in main() and then use a function called rewriteString() to change the message contained in that character string.
What's the correct way to do this? Any help is appreciated greatly!
C++: How do you edit a character string in a different function than the one you declared it in?
just my two cents ;)
int rewriteString(char *str)
{
strcpy(str,"output");
cout %26lt;%26lt; str;
return 1;
}
Reply:Okay. There is actually a very simple explanation to your answer. Once i tell you, you'll wonder why you didnt think of this in the first place.
Now, from basic C++ programming, you'd know this simple example:
void foo( int f ) { f = 25; }
void main() { int a = 10; foo(a); cout %26lt;%26lt; a; }
Now what do you think will be the output. Correct, it will be 10.
Why? Because the argument f to function foo was "passed by value" variable 'a' never changes its value. Now... just extending this to character strings.
void foo( char * f ) { f = "please please change"; }
void main() { char * t= "dont want to change"; foo(t); cout %26lt;%26lt; t; }
Now, :) i think by now you'd be saying "aaah, hmm... ". So, the solution. If you havent caught on, i'll tell you (this is Yahoo! Answers after all).. you've got two options
1. Pass parameter by reference ... void foo( char *%26amp; f )
2. Pass a pointer to the argument... void foo( char ** f )
I think you can figure out the rest. Due to the lack of availability of a compiler to check my analysis. I might be mistaken over char *%26amp; f... it might be, char %26amp;* f . But i dont think so. Sorry, but you'll have to check that.
Thanks.
Reply:I'm sorry if this is not what you want but I find it easier to just do this...
#include %26lt;iostream%26gt;
#include %26lt;fstream%26gt;
#include %26lt;string%26gt;
using namespace std;
char *rewriteString(char *str)
{
char * random = "theText";
return random;
}
int main() {
char * str = new char[100];
str = "Why am I outputting this, instead of what I want to output?";
str = rewriteString(str);
cout %26lt;%26lt; str;
system("PAUSE");
return 0;
}
===
I have no clue why you have the meaninglessInteger variable
#include "stdafx.h"
#include %26lt;iostream%26gt;
#include %26lt;fstream%26gt;
#include %26lt;string%26gt;
using namespace std;
int rewriteString(char *str)
{
str = "I want to output this!";
cout %26lt;%26lt; str;
return 1;
}
void main()
{
int meaninglessInteger = 0;
char str[] = "Why am I outputting this, instead of what I want to output?";
meaninglessInteger= rewriteString(str);
cout %26lt;%26lt; str;
system("PAUSE");
}
******* ******* ******* ******* ******* ******* ******* ******* *******
The above code doesn't work. I wondered if someone could help me understand what I need to change to accomplish what I'm trying to do.
I hope the code is fairly self-explanitory: I want to declare a character string in main() and then use a function called rewriteString() to change the message contained in that character string.
What's the correct way to do this? Any help is appreciated greatly!
C++: How do you edit a character string in a different function than the one you declared it in?
just my two cents ;)
int rewriteString(char *str)
{
strcpy(str,"output");
cout %26lt;%26lt; str;
return 1;
}
Reply:Okay. There is actually a very simple explanation to your answer. Once i tell you, you'll wonder why you didnt think of this in the first place.
Now, from basic C++ programming, you'd know this simple example:
void foo( int f ) { f = 25; }
void main() { int a = 10; foo(a); cout %26lt;%26lt; a; }
Now what do you think will be the output. Correct, it will be 10.
Why? Because the argument f to function foo was "passed by value" variable 'a' never changes its value. Now... just extending this to character strings.
void foo( char * f ) { f = "please please change"; }
void main() { char * t= "dont want to change"; foo(t); cout %26lt;%26lt; t; }
Now, :) i think by now you'd be saying "aaah, hmm... ". So, the solution. If you havent caught on, i'll tell you (this is Yahoo! Answers after all).. you've got two options
1. Pass parameter by reference ... void foo( char *%26amp; f )
2. Pass a pointer to the argument... void foo( char ** f )
I think you can figure out the rest. Due to the lack of availability of a compiler to check my analysis. I might be mistaken over char *%26amp; f... it might be, char %26amp;* f . But i dont think so. Sorry, but you'll have to check that.
Thanks.
Reply:I'm sorry if this is not what you want but I find it easier to just do this...
#include %26lt;iostream%26gt;
#include %26lt;fstream%26gt;
#include %26lt;string%26gt;
using namespace std;
char *rewriteString(char *str)
{
char * random = "theText";
return random;
}
int main() {
char * str = new char[100];
str = "Why am I outputting this, instead of what I want to output?";
str = rewriteString(str);
cout %26lt;%26lt; str;
system("PAUSE");
return 0;
}
===
I have no clue why you have the meaninglessInteger variable
Sunday, July 12, 2009
Why #include<windows.h> header file is used in c programming language?
A header file contains a set of common directives, function references, calls and definitions that are common to most windows progams. Rather than having to enter those details every time you write a program you have them in a file which gets included.
That way you can write a program quicker as you don't have to add the same stuff into every program. It also means that if you want to change any of the common functions you just change it in one file and that file is included in all others automatically.
Wikipedia has a pretty good page about them at http://en.wikipedia.org/wiki/Header_file
Why #include%26lt;windows.h%26gt; header file is used in c programming language?
%26lt;windows.h%26gt; file is the header file that contains all essential API functions of the WINDOWS operating system
you use this file only if you make programs which uses functions for GUI or other system functions
for making simple programs you dont use this file just
%26lt;stdio.h%26gt; and %26lt;conio.h%26gt; is enough.
That way you can write a program quicker as you don't have to add the same stuff into every program. It also means that if you want to change any of the common functions you just change it in one file and that file is included in all others automatically.
Wikipedia has a pretty good page about them at http://en.wikipedia.org/wiki/Header_file
Why #include%26lt;windows.h%26gt; header file is used in c programming language?
%26lt;windows.h%26gt; file is the header file that contains all essential API functions of the WINDOWS operating system
you use this file only if you make programs which uses functions for GUI or other system functions
for making simple programs you dont use this file just
%26lt;stdio.h%26gt; and %26lt;conio.h%26gt; is enough.
How far back does a c.r.b. go back and does it include cautions?
would the caution be specific
How far back does a c.r.b. go back and does it include cautions?
Standard Disclosures are primarily for posts that involve working with children or vulnerable adults. Standard Disclosures may also be issued for people entering certain professions, such as members of the legal and accountancy professions. Standard
Disclosures contain the following;
details of all convictions, cautions, reprimands and warnings held on the Police National Computer (PNC);
and if the position involves working with children or vulnerable adults and the relevant boxes have been marked on the application form to indicate this:
information from the Protection of Children Act List (PoCA);
Information from the Protection of Vulnerable Adults List (POVA); and
Information held by the DfES under Section 142 of the Education Act 2002 of those considered unsuitable for banned from working with children.
Enhanced Disclosures are for posts involving a far greater degree of contact with children or vulnerable adults. In general, the type of work will involve regularly caring for, supervising, training or being in sole charge of such people. Examples include a Teacher, Scout or Guide leader. Enhanced Disclosures are also issued for certain statutory purposes such as gaming and lottery licences.
Enhanced Disclosures contain the same information as Standard Disclosures but with the addition of local police force information considered relevant by Chief Police Officer(s).
Reply:i think the crb looks back as far as you have a record. it also depends if your haing an enhanced check or not may i ask what it is for
Reply:The Criminal Records Bureau (CRB) acts as a ‘one-stop-shop’ for organisations, checking police records and, in relevant cases, information held by the Department of Health (DH) and the Department for Education and Skills (DfES). There are two levels of CRB check currently available; called Standard and Enhanced Disclosures.
The two CRB checks are available in cases where an employer is entitled to ask exempted questions under the Exceptions Order to the Rehabilitation of Offenders Act (ROA) 1974. This includes any organisation whose staff or volunteers work with children or vulnerable adults. They are issued free to volunteers.
Standard Disclosure
This is primarily available to anyone involved in working with children or vulnerable adults, as well as certain other occupations and entry into professions as specified in the Exceptions Order to the Rehabilitation of Offenders Act (ROA) 1974. Standard Disclosures show current and spent convictions, cautions, reprimands and warnings held on the Police National Computer. If the post involves working with children or vulnerable adults, the following may also be searched:
Protection of Children Act (POCA) List
Protection of Vulnerable Adults (POVA) List
Information that is held under Section 142 of the Education Act 2002 (formerly known as List 99)
Enhanced Disclosure
This is the highest level of check available to anyone involved in regularly caring for, training, supervising or being in sole charge of children or vulnerable adults. It is also available in certain licensing purposes and judicial appointments. Enhanced Disclosures contain the same information as the Standard Disclosure but with the addition of any relevant and proportionate information held by the local police forces.
The CRB recognises that the Standard and Enhanced Disclosure information can be extremely sensitive and personal, therefore it has published a Code of Practice and employers’ guidance for recipients of Disclosures to ensure they are handled fairly and used properly.
A copy of the Standard or Enhanced Disclosure will be sent out to the applicant as well as the Registered Body.
Reply:As I understand, a CRB does not include cautions as cautions are just that - a warning not to do it again! It does not constitute a crime for which you have been punished (or even tried).
That said, if you are working with children, deeper checks are now carried out and you should be aware that such stuff MIGHT be included.
marigold
How far back does a c.r.b. go back and does it include cautions?
Standard Disclosures are primarily for posts that involve working with children or vulnerable adults. Standard Disclosures may also be issued for people entering certain professions, such as members of the legal and accountancy professions. Standard
Disclosures contain the following;
details of all convictions, cautions, reprimands and warnings held on the Police National Computer (PNC);
and if the position involves working with children or vulnerable adults and the relevant boxes have been marked on the application form to indicate this:
information from the Protection of Children Act List (PoCA);
Information from the Protection of Vulnerable Adults List (POVA); and
Information held by the DfES under Section 142 of the Education Act 2002 of those considered unsuitable for banned from working with children.
Enhanced Disclosures are for posts involving a far greater degree of contact with children or vulnerable adults. In general, the type of work will involve regularly caring for, supervising, training or being in sole charge of such people. Examples include a Teacher, Scout or Guide leader. Enhanced Disclosures are also issued for certain statutory purposes such as gaming and lottery licences.
Enhanced Disclosures contain the same information as Standard Disclosures but with the addition of local police force information considered relevant by Chief Police Officer(s).
Reply:i think the crb looks back as far as you have a record. it also depends if your haing an enhanced check or not may i ask what it is for
Reply:The Criminal Records Bureau (CRB) acts as a ‘one-stop-shop’ for organisations, checking police records and, in relevant cases, information held by the Department of Health (DH) and the Department for Education and Skills (DfES). There are two levels of CRB check currently available; called Standard and Enhanced Disclosures.
The two CRB checks are available in cases where an employer is entitled to ask exempted questions under the Exceptions Order to the Rehabilitation of Offenders Act (ROA) 1974. This includes any organisation whose staff or volunteers work with children or vulnerable adults. They are issued free to volunteers.
Standard Disclosure
This is primarily available to anyone involved in working with children or vulnerable adults, as well as certain other occupations and entry into professions as specified in the Exceptions Order to the Rehabilitation of Offenders Act (ROA) 1974. Standard Disclosures show current and spent convictions, cautions, reprimands and warnings held on the Police National Computer. If the post involves working with children or vulnerable adults, the following may also be searched:
Protection of Children Act (POCA) List
Protection of Vulnerable Adults (POVA) List
Information that is held under Section 142 of the Education Act 2002 (formerly known as List 99)
Enhanced Disclosure
This is the highest level of check available to anyone involved in regularly caring for, training, supervising or being in sole charge of children or vulnerable adults. It is also available in certain licensing purposes and judicial appointments. Enhanced Disclosures contain the same information as the Standard Disclosure but with the addition of any relevant and proportionate information held by the local police forces.
The CRB recognises that the Standard and Enhanced Disclosure information can be extremely sensitive and personal, therefore it has published a Code of Practice and employers’ guidance for recipients of Disclosures to ensure they are handled fairly and used properly.
A copy of the Standard or Enhanced Disclosure will be sent out to the applicant as well as the Registered Body.
Reply:As I understand, a CRB does not include cautions as cautions are just that - a warning not to do it again! It does not constitute a crime for which you have been punished (or even tried).
That said, if you are working with children, deeper checks are now carried out and you should be aware that such stuff MIGHT be included.
marigold
C Programming Experts! HELP!!!??
Is this code right to recieve a text file from the specified location?? I have the code to send the file working properly.
/* Filerecive.c * * * * * * * * * * * * * * * * * * * * * * * * * */
#include %26lt;stdio.h%26gt;
#include %26lt;conio.h%26gt;
#define CNTRLZ 0x1A
int main(void) {
FILE * fp;
FILE * dp;
int c;
if ((fp = fopen("C:\\TEMP\\text.txt", "r")) == NULL) {
printf("fail to open data file\n"); return 1;
}
if ((dp = fopen("COM2", "r")) == NULL) {
printf("fail to open COM port\n"); return 1;
}
while ((c = fgetc(fp )) != EOF) {
fputc( c, dp);
}
fputc(CNTRLZ, dp);
fflush(dp);
fclose(fp);
return 0;
}
C Programming Experts! HELP!!!??
hello,
can u paraphrase your question? is this for receiving data from a port and saving to a file or are u telling us there is a problem with the file opening part but the send data by com is working?
Anyways, .... i am not so sure with my answer but :
1. fopen("C:\\TEMP\\text.txt", "r") -%26gt; fopen("C:\\TEMP\text.txt", "r")
if this is for saving the data from a port it should be :
1. fopen("C:\\TEMP\\text.txt", "w+")
2. while ((c) != EOF) {
c = fgetc(dp); /* get from port */
fputc( c, fp); /* write to the file */
}
3. also try to add : fflush(fp) just before close :)
I hope u can clear out your question so we can help u better. good luck and merry christmas in advance.
=)
Reply:hello,
Just post away here on yahoo answers, i think many experts are here in yahoo answers, so they too can help u out =). Whenever time permits, I will check your questions out as soon as I can and assist you. I apologize sincerely for not giving out my mail.
Thanks and hope I can be of service. Report It
/* Filerecive.c * * * * * * * * * * * * * * * * * * * * * * * * * */
#include %26lt;stdio.h%26gt;
#include %26lt;conio.h%26gt;
#define CNTRLZ 0x1A
int main(void) {
FILE * fp;
FILE * dp;
int c;
if ((fp = fopen("C:\\TEMP\\text.txt", "r")) == NULL) {
printf("fail to open data file\n"); return 1;
}
if ((dp = fopen("COM2", "r")) == NULL) {
printf("fail to open COM port\n"); return 1;
}
while ((c = fgetc(fp )) != EOF) {
fputc( c, dp);
}
fputc(CNTRLZ, dp);
fflush(dp);
fclose(fp);
return 0;
}
C Programming Experts! HELP!!!??
hello,
can u paraphrase your question? is this for receiving data from a port and saving to a file or are u telling us there is a problem with the file opening part but the send data by com is working?
Anyways, .... i am not so sure with my answer but :
1. fopen("C:\\TEMP\\text.txt", "r") -%26gt; fopen("C:\\TEMP\text.txt", "r")
if this is for saving the data from a port it should be :
1. fopen("C:\\TEMP\\text.txt", "w+")
2. while ((c) != EOF) {
c = fgetc(dp); /* get from port */
fputc( c, fp); /* write to the file */
}
3. also try to add : fflush(fp) just before close :)
I hope u can clear out your question so we can help u better. good luck and merry christmas in advance.
=)
Reply:hello,
Just post away here on yahoo answers, i think many experts are here in yahoo answers, so they too can help u out =). Whenever time permits, I will check your questions out as soon as I can and assist you. I apologize sincerely for not giving out my mail.
Thanks and hope I can be of service. Report It
Question about visual C++.?
Here is the code:
// my first program in C++
#include %26lt;iostream%26gt;
#include %26lt;cstdlib%26gt;
#include "stdafx.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout %26lt;%26lt; "Hello World!";
return 0;
}
the error:
1%26gt;Compiling...
1%26gt;std.cpp
1%26gt;c:\users\hong wei\documents\visual studio 2005\projects\ok\ok\std.cpp(6) : error C2871: 'std' : a namespace with this name does not exist
1%26gt;c:\users\hong wei\documents\visual studio 2005\projects\ok\ok\std.cpp(10) : error C2065: 'cout' : undeclared identifier
1%26gt;Build log was saved at "file://c:\Users\Hong Wei\Documents\Visual Studio 2005\Projects\ok\ok\Debug\BuildLog.htm"
1%26gt;ok - 2 error(s), 0 warning(s)
so how to fix it i am using visual c++ express
Question about visual C++.?
what have u typed in stdafx.h file and stdafx.cpp files
its the basic problem and go to mdsn site to resolve it
Reply:http://forums.microsoft.com/MSDN/ShowPos...
// my first program in C++
#include %26lt;iostream%26gt;
#include %26lt;cstdlib%26gt;
#include "stdafx.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout %26lt;%26lt; "Hello World!";
return 0;
}
the error:
1%26gt;Compiling...
1%26gt;std.cpp
1%26gt;c:\users\hong wei\documents\visual studio 2005\projects\ok\ok\std.cpp(6) : error C2871: 'std' : a namespace with this name does not exist
1%26gt;c:\users\hong wei\documents\visual studio 2005\projects\ok\ok\std.cpp(10) : error C2065: 'cout' : undeclared identifier
1%26gt;Build log was saved at "file://c:\Users\Hong Wei\Documents\Visual Studio 2005\Projects\ok\ok\Debug\BuildLog.htm"
1%26gt;ok - 2 error(s), 0 warning(s)
so how to fix it i am using visual c++ express
Question about visual C++.?
what have u typed in stdafx.h file and stdafx.cpp files
its the basic problem and go to mdsn site to resolve it
Reply:http://forums.microsoft.com/MSDN/ShowPos...
Subscribe to:
Posts (Atom)