如何修复“错误C1033:无法打开程序数据库”?

时间:2016-03-26 06:28:41

标签: c++ c visual-studio

我正在尝试构建一个用户选择辅音/元音的程序,并且每次都选择随机字母并添加到字符串中,类似于电视节目倒计时。我在标题中遇到了错误。当我尝试编译控制台时,读取该文件不可读为可执行文件。

// April16Assignment.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdlib.h>
#include <string>
using namespace std;

int main(){

char type, letters[10];
char vowels[6] = { 'A', 'E', 'I', 'O', 'U' };
char consonants[22] = { "B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "X", "Y", "Z" };
int i, j, k, l;

for (i = 0; i < 9; i++){
printf("Vowel or consonant? (V/C)");
scanf("%c", &type);

if (type == 'V')
    for (k = 0; k<1; k++){
        j = (rand() % 5);
        strcat(letters, vowels[j]);

    }
if (type == 'C')
    for (l = 0; l<1; l++){
        j = (rand() % 21);
        strcat(letters, consonants[j]);

    }
else
    printf("Invalid!");
break;
}
    printf("%s", letters);
return 0;
}

0 个答案:

没有答案