electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

help required on array operation in C


Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing -> help required on array operation in C
Author Message
mformazhar1980



Joined: 23 Mar 2009
Posts: 14


Post25 Oct 2009 11:09   

help required on array operation in C


hi

i need to do some operation on an array in my program but dont know how to do that.
can any body help me out of this situation.

actually i am filling an array with boolean data that is 0's and 1's during a while loop.
what i want that after getting filled with unknown values i should be able to separate the array element. the

code snippet shows the while loop that is filling the required boolean array as per condition
Code:

 bool Value[1000];
int ctr=0;
 
while(ctr<1000 && Pulse_Line_Cnt ==156)

{
Value[ctr]= PC7;  // PC7 is a variable that has a randam boolean data
ctr++;
}


now i dont know how to process it further i mean after getting filled Value[ctr] with 0's and 1's i need to

separate all 0 values and all 1 values from this array.

the data i am expecting in the array are supposed to be first 1's then 0's and then 1's then 0's again
so its not only separating the elements but also like i should know how many 0's appear before the 1's and

after that how many 1's appear after next bunch of 0's and so on untilthe end of array.after gettig the exact

number of 0's and 1's can be stored in any integer variable for further treatment.

can some body help me of this thanks. i am attaching a picture to clarify my point

thanks
Back to top
Google
AdSense
Google Adsense




Post25 Oct 2009 11:09   

Ads







Sorry, but you need login in to view this attachment

Back to top
tjr



Joined: 02 Mar 2006
Posts: 70


Post01 Nov 2009 13:43   

Re: help required on array operation in C


Do bitwise & and | operation with ur boolean date and store it
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing -> help required on array operation in C
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
ADS Patch array simulation 2.45 GHz (help required) (6)
ARRAY + HFSS....Tip required (2)
array setup +HFSS...tips required (3)
[Help] Amplifier Operation (5)
UNDERSTANDING TV (DIAGRAM/OPERATION) Help!!! (1)
Help in operation of pipeline ADC (2)
[ie3d help ] how to do boolean operation ? (2)
BJT(npn) physical operation help! (2)
Need help to know a VCO operation (1)
Need help on real time software operation (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS