okay i get it then! thx guys
Type: Posts; User: n3cr0_l0rd
okay i get it then! thx guys
umm... as i read in accelerated cpp, i should be doing
using std::cout;
using std::cin;
.........
Do you mean that ?
@brafil, u mean i shouldn't do using namespace std; ???
and thx to all
// To convert meter to feet and inch
#include <iostream>
using namespace std;
const float M = 3.25;
class distance
{
private:
int feet;
float inch, meter;
public:
huh... after a short 2 days vacation i finally figured it out.. i will use getch() to input keys (for now wsad, will go for arrow keys shortly) and create a function gotoxy using windows.h faq lvl 2...
i had expected it to be an easy job... isnt there any other way?
i just wanted to make a program that can move a '-' according to directional key input.. but i dont know how to take input of the direction keys...
key = getch ();
if (key == ????).....
...
i had a look at the MS MSDN page,.. but how to i link to the kernel32.lib and kernel32.dll
i didnt hear anything..
one more question, i would like to produce a beep sound if the input is not 0 or 1. I searched for it in the net and found '\a' but that didnt help me. So, how can i produce a beep sound?
Edit:...
Thx, that helped..
void readtemp ()
{
do
{
system ("cls");
cout << "1. Celsius to Fahreinheit" << endl << "2. Fahreinheit to Celsius" << endl;
...
lol, yeah
I didn't put cout inside the loop so i was confused.. thx
and one more question, if i use double instead of float, still i can display only 6 digits in total... any help?
#include <iostream>
//#include <string>
using namespace std;
class temp
{
private:
float t,r;
char choice;
public:
void readtemp ()
The loop will continue if the input is 0. But that would be useless because if the input is 0, you will just keep on looping without doing anything. If you meant to loop every time the input is not...
@Elysia Thx, i get it... You are really too great :D
When i looked back into the codes in that book, it had included <string> header file too... But why? I couldnt get it why? The original code in the book:
// ask for a person's name, and generate...
// Input your full name and put it in a frame
#include <iostream>
using namespace std;
int main()
{
cout<<"Enter your full name : ";
string name;
getline(cin,name);
const string greet =...
yeah... great book for me.. m reading it atm... thx for that
hope the above question was not stupid attempt of me trying to act as not stupid at all :P:D
one final question.. that means using
std::getline() and
getline() means the same or different... ?
blame me for being dependent on teacher as he never said what :: and >>/<< acutually mean... any source i can learn all the basics of c++? Now i feel too much desperate for knowing nothing...
Sorry but i didnt get how i referred getline as object ? My teachers suck at teaching... so could you plz explain it... seriously, you plz suggest me a FREE e-book so i can learn everything from...
error: no match for 'operator>>' in 'std::getline >> m1[i].movies::name'
i replaced cin with std::getline and got that errror.. could you plz elaborate it... sry but never done c++ before this......