Click here to Skip to main content
15,917,618 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Exe size Pin
User 988511-Feb-03 13:46
User 988511-Feb-03 13:46 
GeneralRe: Exe size Pin
Chris Losinger11-Feb-03 14:19
professionalChris Losinger11-Feb-03 14:19 
GeneralRe: Exe size Pin
Mike Nordell10-Feb-03 14:58
Mike Nordell10-Feb-03 14:58 
GeneralRe: Exe size Pin
Neville Franks10-Feb-03 23:53
Neville Franks10-Feb-03 23:53 
QuestionCan someone give me examples of using these SQL statements?? Pin
IrishSonic10-Feb-03 12:04
IrishSonic10-Feb-03 12:04 
AnswerRe: Can someone give me examples of using these SQL statements?? Pin
xxhimanshu10-Feb-03 17:35
xxhimanshu10-Feb-03 17:35 
GeneralUsing askey in a file Pin
proprogram10-Feb-03 12:01
sussproprogram10-Feb-03 12:01 
GeneralRe: Using askey in a file Pin
Mike Nordell10-Feb-03 12:29
Mike Nordell10-Feb-03 12:29 
proprogram wrote:
Hey all. I'm having some trouble figuring out askey.

I haven't got a clue what "askey" is. My best guess it that you heard someone say it - in case it's spelled ASCII (American Standard Code for Information Interchange).

What you want to do is find the frequency of characters in a given file, and you are on the right track with the question:

how would I make a vector that has a slot for each letter in the alphabet increase by 1 every time a letter is found that corrosponds to that slot in the vector?

You first create a vector, or even an array since you know in advance that you'll only have to deal with at most 256 different values. Let's use the shortest code and use an array:

// The following line creates an array of 256
// unsigned integers, initializing all of them to zero.
unsigned int freq[256] = { 0 };

// 1.
// Here you are supposed to read through your file,
// one byte at a time, and put the read [unsigned char]
// value into a variable. Let's call it foo.

unsigned char foo = read_next_byte();

// 2.
// The following line uses the character value
// (if in a particular range also called the ASCII code)
// as an index into the array. Let's tell it we've found
// another character/byte with this value.
// Note that for a closed set like this (0-255), the
// index itself is actually also a data carrier.
// This can be worth recognising for further adventures
// into computing algorithms.
++freq[foo];

// Jump back to 1 until the file/stream is exhausted.

Now you can do whatever you like with your array.

++luck;
GeneralAccessing data/file when app launched from attachment Pin
Dr Soong10-Feb-03 11:43
Dr Soong10-Feb-03 11:43 
GeneralRe: Accessing data/file when app launched from attachment Pin
JoeSox10-Feb-03 12:09
JoeSox10-Feb-03 12:09 
GeneralRe: Accessing data/file when app launched from attachment Pin
Mike Nordell10-Feb-03 15:08
Mike Nordell10-Feb-03 15:08 
QuestionHow to get my DNS server ? Pin
Yasen Georgiew10-Feb-03 11:05
Yasen Georgiew10-Feb-03 11:05 
AnswerRe: How to get my DNS server ? Pin
Rene De La Garza10-Feb-03 11:37
Rene De La Garza10-Feb-03 11:37 
GeneralNT Service would not start...! Pin
Prabhakar10-Feb-03 10:57
Prabhakar10-Feb-03 10:57 
GeneralRe: NT Service would not start...! Pin
palbano10-Feb-03 11:06
palbano10-Feb-03 11:06 
GeneralRe: NT Service would not start...! Pin
Prabhakar10-Feb-03 11:26
Prabhakar10-Feb-03 11:26 
GeneralRe: NT Service would not start...! Pin
Kant11-Feb-03 5:22
Kant11-Feb-03 5:22 
GeneralRe: NT Service would not start...! Pin
Kant11-Feb-03 5:32
Kant11-Feb-03 5:32 
GeneralUsing .NET objects in C++ Pin
OBRon10-Feb-03 10:11
OBRon10-Feb-03 10:11 
GeneralDetect file writing Pin
zebiloute10-Feb-03 9:13
zebiloute10-Feb-03 9:13 
GeneralRe: Detect file writing Pin
Neville Franks10-Feb-03 9:25
Neville Franks10-Feb-03 9:25 
GeneralRe: Detect file writing Pin
Mike Nordell10-Feb-03 11:25
Mike Nordell10-Feb-03 11:25 
GeneralProblem with Unix linefeeds in VS.NET Pin
Jim A. Johnson10-Feb-03 9:04
Jim A. Johnson10-Feb-03 9:04 
GeneralRe: Problem with Unix linefeeds in VS.NET Pin
Chris Losinger10-Feb-03 9:46
professionalChris Losinger10-Feb-03 9:46 
GeneralUsing Symbol Server with VC6 Pin
dcr10-Feb-03 8:53
dcr10-Feb-03 8:53 

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.