how to solve this problem

absolute beginner.

using microsoft visual studio.

all i want to do is type in 'A' and enter, and for words to beginning with 'A' such as 'Assist' to pop up.

// predictive keyboard.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{

char i='A';

char mystring['A'];

mystring['A']=("Allow")

printf("Welcome to Predictive Keyboard Programme: ");

scanf("%s", &i);

if (i='A')
printf ("Allow")
else
printf ("type in another character")

printf("You entered: %s\n", mystring);


return 0;
}


please help.

thanks.

sam.
Are you using visual basic or C++? Well I was working on a very detailed reply with code but it was deleted by mistaked so I'm making this short and simple. The program isn't going to know what words start with A to bring up in the list if you don't tell it what to bring up.

If the user enters A, use a function to call out a certain list of words that begin with a.

Pseudo code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
include <iostream>

using namespace std;

void Awords()
{
cout<<"words beginning with A go here";
}

int main()
{
   user enters a;
   Awords(); // calls Awords function, printing list of words that begin with a

etc.

Last edited on
This code should/would generate an error:
1
2
3
char mystring['A'];

mystring['A']=("Allow") 


A character array has to be declared using a number.
i.e. char mystring[10];

You would have to create a word bank or list to pull words that begin with a certain letter from.

Btw Warrior that is actually C.
Last edited on
Topic archived. No new replies allowed.