Not outputting full thing
Nov 5, 2016 at 2:32am UTC
So for the longest time i had to experiment around and find out how to just get the char thing to work and i find no where how to get a full word to display have i overlooked something or what?
When i type the name "JIM" it says Welcome J not JIM
Any Help is Appreciated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
// ConsoleApplication3.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <cstdlib>
using namespace std;
int value1, value2, result, status;
char choice, namespace1, namespace2, namespace3, name, yes;
int main()
{
system("title Quick Attack Game" );
system("color 4" );
cout << "Welcome to The Game!\n" ;
cout << "Please enter the first 3 letters of your name\n" ;
cin >> name;
cout << "Welcome" <<name<< "To the quick attack game!\n\n" ;
cout << "Ready to begin?\n" ;
cin >> choice;
if (choice = yes)
cout << "Ok, Let's Begin!\n" ;
}
Nov 5, 2016 at 2:36am UTC
char choice, namespace1, namespace2, namespace3, name, yes;
Should be :
1 2
char name[9999];
char choice, namespace1, namespace2, namespace3, yes;
Last edited on Nov 5, 2016 at 2:36am UTC
Nov 5, 2016 at 3:20am UTC
Or even better:
1 2
#include <string>
string name;
Topic archived. No new replies allowed.