Click here to Skip to main content
16,006,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to display date and time in one control Pin
David Crow10-Jun-03 2:28
David Crow10-Jun-03 2:28 
GeneralRe: How to display date and time in one control Pin
Bosicat10-Jun-03 15:02
Bosicat10-Jun-03 15:02 
GeneralSaving data in edit boxes - Visual C++ 6 Professional Pin
wancopr9-Jun-03 15:21
wancopr9-Jun-03 15:21 
GeneralRe: Saving data in edit boxes - Visual C++ 6 Professional Pin
Toni789-Jun-03 20:16
Toni789-Jun-03 20:16 
GeneralRe: Saving data in edit boxes - Visual C++ 6 Professional Pin
wancopr12-Jun-03 14:19
wancopr12-Jun-03 14:19 
Generalsearching arrays Pin
InternetMill9-Jun-03 12:58
InternetMill9-Jun-03 12:58 
GeneralRe: searching arrays Pin
Michael Dunn9-Jun-03 13:13
sitebuilderMichael Dunn9-Jun-03 13:13 
GeneralRe: searching arrays Pin
bond0069-Jun-03 13:29
bond0069-Jun-03 13:29 
I'm not sure if I understood you, but that's quite simple. An example:

------------------------------------------
#include <iostream.h>
#include <memory.h>
#include <stdlib.h>

void main()
{
char singleLetter;
bool wordCompleted = false;
unsigned int numOfLetters;
unsigned int numOfGuessedLetters = 0;

cout << "Number of letters: ";
cin >> numOfLetters;

char* pArray1 = new char[numOfLetters+1];
char* pArray2 = new char[numOfLetters+1];
memset(pArray2,'_',numOfLetters);
pArray2[numOfLetters] = '\0';

cout << "Type in the word: ";
cin >> pArray1;

system("cls"); // Should the other player see what word we've typed in? Wink | ;)

while(wordCompleted==false)
{
cout << "Type in a letter: ";
cin >> singleLetter;

for(unsigned int i=0;i<numOfLetters;i++)
{
if(singleLetter==pArray1[i])
{
pArray2[i] = singleLetter;
numOfGuessedLetters++;
}
}

if(numOfGuessedLetters==numOfLetters)
{
cout << "\n\n";
cout << "Current status: " << pArray2 << endl;
cout << "Hey dude! You won!" << endl;
break;
}
else
cout << "Current status: " << pArray2 << endl;
}

delete [] pArray1;
delete [] pArray2;
}
GeneralRe: searching arrays Pin
InternetMill9-Jun-03 13:57
InternetMill9-Jun-03 13:57 
GeneralRe-using a socket after a completed AcceptEx() call! Pin
bond0069-Jun-03 11:46
bond0069-Jun-03 11:46 
GeneralRe: Re-using a socket after a completed AcceptEx() call! Pin
valikac9-Jun-03 15:10
valikac9-Jun-03 15:10 
GeneralRe: Re-using a socket after a completed AcceptEx() call! Pin
bond0069-Jun-03 20:29
bond0069-Jun-03 20:29 
GeneralRe: Re-using a socket after a completed AcceptEx() call! Pin
geo_m9-Jun-03 21:25
geo_m9-Jun-03 21:25 
Generalnew Threads and MultiThreads Pin
johnstonsk9-Jun-03 11:01
johnstonsk9-Jun-03 11:01 
GeneralRe: new Threads and MultiThreads Pin
bond0069-Jun-03 13:08
bond0069-Jun-03 13:08 
GeneralMy program doesn't recognize &quot;sin&quot; - but I've included &lt;math.h&gt; Pin
kleft9-Jun-03 10:07
kleft9-Jun-03 10:07 
GeneralRe: My program doesn't recognize &quot;sin&quot; - but I've included &lt;math.h&gt; Pin
David Crow9-Jun-03 10:30
David Crow9-Jun-03 10:30 
GeneralRe: My program doesn't recognize &quot;sin&quot; - but I've included &lt;math.h&gt; Pin
kleft9-Jun-03 11:04
kleft9-Jun-03 11:04 
GeneralRe: My program doesn't recognize &quot;sin&quot; - but I've included &lt;math.h&gt; Pin
peterchen9-Jun-03 21:44
peterchen9-Jun-03 21:44 
GeneralRe: My program doesn't recognize &quot;sin&quot; - but I've included &lt;math.h&gt; Pin
Roger Allen10-Jun-03 0:36
Roger Allen10-Jun-03 0:36 
QuestionCarriage return and line feed, y use them in files?? Pin
IrishSonic9-Jun-03 8:30
IrishSonic9-Jun-03 8:30 
AnswerRe: Carriage return and line feed, y use them in files?? Pin
David Crow9-Jun-03 9:23
David Crow9-Jun-03 9:23 
AnswerRe: Carriage return and line feed, y use them in files?? Pin
Christian Graus9-Jun-03 16:13
protectorChristian Graus9-Jun-03 16:13 
AnswerRe: Carriage return and line feed, y use them in files?? Pin
David Chamberlain10-Jun-03 3:19
David Chamberlain10-Jun-03 3:19 
GeneralIDE (vc++ 6) Pin
Maximilien9-Jun-03 8:17
Maximilien9-Jun-03 8:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.