![]() |
| | #1 |
| Registered User Join Date: Mar 2008
Posts: 47
| constant structure array - hlep please ![]() Code: //**************************
typedef struct
{
int note;
int beats;
}Note_Beats;
//**************************
//***********************************************
//***************Song list***********************
//***********************************************
//********When The Saints Go Marching In*********
#define NumberOfBeats_Saints 16
const Note_Beats Saints[NumberOfBeats_Saints] = { {C6, 1}, {E6, 1}, {F6, 1}, {G6, 5}, {C6, 1}, {E6, 1}, {F6, 1}, {G6, 5}, {C6, 1}, {E6, 1}, {F6, 1}, {G6, 2}, {E6, 2}, {C6, 2}, {E6, 2}, {D6, 5} };
//***********************************************
//**************Choose Song Here*****************
#define NumberOfBeats NumberOfBeats_Saints
const Note_Beats Song = Saints;
//***********************************************
ie at this code: Code: const Note_Beats Song = Saints; |
| dezz101 is offline | |
| | #2 |
| Registered User Join Date: Mar 2008
Posts: 47
| can you not make an array equal to another array or something??? sooo consfused : |
| dezz101 is offline | |
| | #3 |
| Registered User Join Date: Jan 2002 Location: Northern Virginia/Washington DC Metropolitan Area
Posts: 2,870
| Code: const Note_Beats Song = Saints; Code: const Note_Beats Song(Saints);
__________________ On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. --Charles Babbage, 1792-1871 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 |
| hk_mp5kpdw is offline | |
| | #4 |
| +++ OK NO CARRIER Join Date: Oct 2001
Posts: 10,642
| Why don't you just make a list of songs, and wander through it with a pointer? Quzah.
__________________ Hundreds of thousands of dipshits can't be wrong. Are you up for the suck? |
| quzah is offline | |
| | #5 | |
| Registered User Join Date: Mar 2008
Posts: 47
| Quote:
and what is this code going to do?? Code: const Note_Beats Song(Saints); | |
| dezz101 is offline | |
| | #6 | |
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,785
| You are trying to assign an array to a single element. How can you fit several rooms inside one room? The line of code you are confused about is C++ syntax. If you do not use C++, you can ignore it.
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| |
| Elysia is offline | |
| | #7 |
| I like turtles Join Date: Sep 2009 Location: Ohio
Posts: 322
| Code: { {C6, 1}, {E6, 1}, {F6, 1}, {G6, 5}, {C6, 1}, {E6, 1}, {F6, 1}, {G6, 5}, {C6, 1}, {E6, 1}, {F6, 1}, {G6, 2}, {E6, 2}, {C6, 2}, {E6, 2}, {D6, 5} }
|
| Epy is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cannot allocate an array of constant size 0 | steve1_rm | C Programming | 9 | 05-26-2009 03:57 AM |
| Syntax for constant array of array pointers | BMintern | C Programming | 4 | 05-14-2008 08:21 AM |
| 2D array becoming "deallocaded" | Aaron M | C Programming | 2 | 09-23-2006 07:53 AM |
| Filling an array in a structure | thephreak6 | C Programming | 1 | 12-16-2002 06:05 PM |
| Hi, could someone help me with arrays? | goodn | C Programming | 20 | 10-18-2001 09:48 AM |