call stack below: ucrtbased.dll!01905fcc() Unknown [Frames below may be incorrect and/or missing, no symbols loaded for ucrtbased.dll] [External Code] basketball.exe!_vfprintf_l(_iobuf * const _Stream, const char * const _Format, __crt_locale_pointers * const _Locale, char * _ArgList) Line 639 C++ basketball.exe!printf(const char * const _Format, ...) Line 954 C++
basketball.exe!main() Line 81 C++ [External Code]
//I keep getting an access violation.
#include <iostream>
#include <string>
using namespace std;
int main()
{
int x;
string playername, hometown,position,height,Class;
int weight;
cout << "Enter player number: ";
cin >> x;
switch(x){
case 0: {
playername = "Brandon Sampson";
position = "Guard";
weight = 193;
hometown = "Baton Rouge, LA";
height = "6-5";
Class = "Sophomore";
break;
}
case 1: {
playername = "Dupo Reath";
position = "Forward";
weight = 235;
hometown = "Perth, Australia";
height = "6-10";
Class = "Junior";
break;
}
case 2: {
playername = "Antonio Blakeney";
position = "Guard";
weight = 197;
hometown = "Sarasota, Fla";
height = "6-4";
Class = "Sophomore";
break;
}
case 3: {
playername = "Elbert Robinton III";
position = "Center";
weight = 290;
hometown = "Garland, Texas";
height = "7-1";
Class = "Junior";
break;
}
case 4: {
playername = "Skylar Mays";
position = "Guard";
weight = 205;
hometown = "Baton Rouge, La";
height = "6-4";
Class = "Junior";
break;
}
case 5: {
playername = "Kieran Hayward";
position = "Guard";
weight = 195;
hometown = "Sydney, Australia";
height = "6-4";
Class = "Freshman";
break;
}
case 10: {
playername = "Branden Jenkins";
position = "Guard";
weight = 180;
hometown = "Maywood, Ill";
height = "6-4";
Class = "Junior";
break;
}
}
printf("Name: %s", playername);
printf("Position: %s\n", position);
printf("Height: %s", height);
printf(" Weight: %d", weight);
printf("Hometown: %s\n", hometown);
printf("Class: %s\n", Class);
return 0;
}