#include <iostream>
using namespace std;
int main()
{
const int MAX = 20;
char name[MAX];
cout << "What is your name?\n";
cin.getline(name,MAX,'\n');
cout << "Hello " << name;
Type: Posts; User: marCplusplus
#include <iostream>
using namespace std;
int main()
{
const int MAX = 20;
char name[MAX];
cout << "What is your name?\n";
cin.getline(name,MAX,'\n');
cout << "Hello " << name;
Hey,
I learnt most of what I know from online stuff.
Books will obviously save you alot of time in the long run.
If you're just starting, PM me or send me an e-mail and I'll give you a couple...
Hey sup,
IanelarAzure,you should use a for loop to add them up.
Have a look:
#include<iostream>
#include<string>
using namespace std;
Hey sup,
Also, you can either use getch() or getche() :)
getch() will return the character you type
getche() does the same but also shows the character typed on the screen :)
Rgrds,
Marc
You're good... :D
Here...
// newgame() function
void newgame()
{
personal();
I'll keep that in mind for next time :D :D
Thanks :D
Here's a shorter version of my 'game' :)
#include <iostream.h>
#include <windows.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
Hi all,
I created a simple game (my first one) with C++.
It works well except for when I try to exit whilst I'm playing a game.
Have a look at the code and you'll see what I mean :(
Also, I...
Thanks, it worked :D
A question though, why is there need to do that? Shouldn't it work well without the for loop?
Rgrds,
Marc :D
Thanks for your answers!
Here is the code I tried:
do
{
system("CLS");
cout<<"\n\n\t[[ Scissors, Paper, Stone 2002 ]] - [ Coded by mvb ]";
cout<<"\n\n\t[ N E W G A M E ]";
:eek: :eek: :D :D
Thanks, it worked!
a question if you don't mind :D
..How did you know about that? Is it experience or is there a general pattern one should follow when using cin.ignore?
...
Hi,
Try to run this code:
#include<iostream.h>
#include<windows.h>
#include<conio.h>
//constants
Hi,
I am a newbie at C++.
I've made my first program in C++.
It's quite small, 181 lines of code in fact :)
I finally got it to compile and run successfully :)
The thing is, I had to use...
Geezzzzz, I didn't even notice... :eek:
Stupid me! :D :D
Thanks :)
Oh, I tried to take off the case 'q': case 'Q': thing...
Still gets the error :(
Any ideas? :)
hmm, what's: toupper(input) = 'Q' ? :)
Hi everyone :)
I coded a small program, it works well except when I try to quit it by pressing 'q' or 'Q'. When I do this, an error message comes up saying "The memory could not be read".
...
Hmm, thanks .... this seems to work well:
#include <iostream.h>
#include <conio.h>
class employee
{
private:
char name[20];
The Dog: Yup, no luck!
The following worked tho:
cout<<"Enter Name: "<<flush;
What dya think?
#include <iostream.h>
#include <conio.h>
class employee
{
private:
char name[20];
int n;
int serial_number;
public:
void input()
Hi everyone,
I'm trying out an exersize of a book I'm reading.
Have a look at the code:
#include <iostream.h>
#include <conio.h>
class employee
{
private:
:D :D np :D
NO!!! :eek:
I said that coz you made me shy :p
:D :D
Yes,yes I understood :)
It was a compliment coz you would ask me for some help :D