Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


c++ how can i do this?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Thu Jul 02, 2009 10:09 pm    Post subject: c++ how can i do this? Reply with quote

I want to have an array of chars

A,A#,B,C,C#,D,D#,E,F,F#,G,G#,A

How can i put these into an array so that i can do this (example since i dont know how to say it) :
I want to select A# which is place 2 in the array. Using a tradition char array i would only get the A and not the #, which is useless. So i need to be able to select A# in 1 place.

I really dont know how to put it so lemme know if you need more detail. I am basically trying to printf the notes that are playing in my scale app instead of freq.

_________________
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Jul 02, 2009 10:34 pm    Post subject: Reply with quote

You can either:

1. Make it an array of strings instead of characters, and parse check the length to find out if it has an extra character (being the sharp)

2. Make a struct that contains the letter as a char and then a boolean to represent it as a sharp or not. If you did it this way you could also add sharp, flat, etc.

Code:
#define NOTE_NONE    0
#define NOTE_FLAT    1
#define NOTE_SHARP   2

struct NOTE
{
    CHAR cNote;
    DWORD dwFrequency;
};


Then you could make a function to parse the struct, check the frequency and make a string from it.

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites