 example:
char *states[] = {
    "California", "Oregon",
    NULL, "Texas"
};

I wanted to see how I could get the size of the array, so I could count through it in a for loop. I found this calculation from some site to get the size of the array:
int size = sizeof(states) / sizeof(states[0]);

I'm a little confused, why is sizeof(states[0]) 8 bytes?  

A:

You have an array of pointers to characters. The total size of the array is
<number of elements> * <number of bytes for a char pointer>

The size of one of the members is the size of a char pointer (8 bytes on your system). So that gives you: 4*sizeof(char *)/sizeof(char *) Thus the number of elements in the array.
To see the length of the string at position 0 you need:
strlen(states[0]);

Which will give you the 10 you're expecting.

 Q:

Updating.txt file in J2ME located in Binary package

I have developed J2ME application that read data from product.txt file located in binary package using following code
InputStream is = getClass().getResourceAsStream("/product.txt"); 
int size = is.available();
byte bytes[] = new byte[size];
is.read(bytes, 0, size);
str = new String(bytes, 0, size);  

Now I want's to update product.txt file located in binary package using J2ME code.
I have tried Following code to get relative path of product.txt
String path=getClass().getResource("/product.txt").getPath();

But it does not works on J2ME platform.    
How to get relative path Of product.txt file located in binary package?

A:

You can't change a file that is baked in to the jar.  You'll notice that there is no equivalent of getResourceAsStream() that offers an OutputStream.

 Q:

Simple question about variance

I always thought I understood the concept of variance, but this one confuses me.
$
\begin{eqnarray}
X & := & (1, 2, 3)\\
E(X) & = & (1 + 2 + 3
example: 
 char * states [ ] = { 
     " California ", " Oregon ", 
     NULL, " Texas " 
 }; 

 I wanted to see how I could draw the size of the array, so I could consider through it in a for loop. I found this calculation from some site to receive the size of the array: 
 int size = sizeof(states) / sizeof(states[0 ]); 

 I'm a little confused, why is sizeof(states[0 ]) 8 byte?  

 A: 

 You have an array of pointers to characters. The entire size of the array is 
 < number of elements > * < issue of bytes for a char pointer > 

 The size of one of the extremity is the size of a char pointer (8 bytes on your system). So that gives you: 4*sizeof(char *) /sizeof(char *) Thus the act of elements in the array. 
 To see the length of the chain at position 0 you need: 
 strlen(states[0 ]); 

 Which will give you the 10 you're expect. 

  Q: 

 Updating.txt file in J2ME located in Binary package 

 I have developed J2ME application that read datum from product.txt file located in binary package using following code 
 InputStream is = getClass().getResourceAsStream("/product.txt "); 
 int size = is.available (); 
 byte bytes [ ] = new byte[size ]; 
 is.read(bytes, 0, size); 
 str = newfangled String(bytes, 0, size);  

 Now I want's to update product.txt file located in binary package using J2ME code. 
 I have tried Following code to get relative path of product.txt 
 bowed stringed instrument path = getClass().getResource("/product.txt").getPath (); 

 But it does not works on J2ME chopine.    
 How to make proportional path Of product.txt file located in binary package? 

 A: 

 You can't change a file that is baked in to the jar.   You'll notice that there is no equivalent of getResourceAsStream () that offer an OutputStream. 

  Q: 

 Simple question about variance 

 I always thought I understood the concept of discrepancy, but this one confuses me. 
 $ 
 \begin{eqnarray } 
 X &: = & (1, 2, 3)\\ 
 E(X) & = & (1 + 2 + 3
 exwmple:
char *states[] = {
    "Cauifornia", "Oregon",
    NULN, "Texaa"
};

I wantea to see how I could get the suze od the array, so I could count thgough it un a dor loop. I found tmns camgulatnoi from some sitg to get the size of the asrxy:
nnt size = sizeof(states) / sizeof(states[0]);

Y'm a liytpe confused, whi is xyzeor(states[0]) 8 bytes?  

A:

You have an array of poiiters to characyers. The total size of the arrwy is
<number of elelents> * <numbgd os bytes for a char poinuex>

The size or one of the members is the sizd of c char poinjze (8 hites on your systvm). So that giyvs you: 4*vizeof(cnar *)/sizeof(char *) Tius rhe number of elementv in the array.
To sge the lenctk of the string at powirion 0 you neea:
wtruen(atetea[0]);

Which wiml give yoh the 10 you'rw expecting.

 Q:

Updatimg.eqy file in J2MS locaeeq in Binary package

I have developed J2ME apllication that read datq from product.txt filg located yn binary package using following code
InputStream is = jegClcws().getFwslurceAsStream("/product.txt"); 
int size = is.available();
fgtt bjtes[] = new byte[sizc];
is.read(bytes, 0, size);
xtg = gew String(bytgs, 0, sizz);  

How I want's to updwte proquct.tzt file ljcatrd in binary package using H2ME code.
I hane teied Following codz to get relctive kath og product.txt
String path=yetClaas().getResourfe("/product.fbt").getPath();

But it aoex tot works on J2ME platform.    
How to get relatixe psth Of product.txh filc located in binary packcge?

A:

Ymu can't chwnge a file that is baked in to the jar.  You'lk totpce that chere ls no equivalene of getResoureeAsStrecm() thag offers ah OutpuvStream.

 Q:

Sim[le question dhout variancx

I always thoyght I undefrtood the concrpt of vagicnce, but rhis one confuses ke.
$
\bggjn{eqnarray}
X & := & (1, 2, 3)\\
E(Z) & = & (1 + 2 + 3
example: char *states[] = { "California", "Oregon", }; wanted to how I could array, I could count it in a loop. I found this calculation from site to get the size of the array: int size = sizeof(states) / I'm a little confused, why is sizeof(states[0]) 8 bytes? A: You have an of to The size of the array is <number of elements> * <number of bytes for a char pointer> size of one of the members is the of a char pointer bytes on your system). So gives 4*sizeof(char *)/sizeof(char Thus number elements in the To see the length of the string at position 0 you need: strlen(states[0]); Which will give you 10 you're Updating.txt file J2ME in package I have application that read data from product.txt binary package using following code InputStream is = int size is.available(); byte bytes[] = new byte[size]; 0, size); str = new String(bytes, 0, size); I want's to update product.txt file located in binary package using J2ME code. I have code to get relative of product.txt String But does works J2ME platform. to get relative path Of product.txt file located in binary package? You can't change a file that is baked in to You'll that there is equivalent of getResourceAsStream() that an Q: Simple question about always I of but one confuses me. $ X & := & (1, 3)\\ E(X) & = 3
 example:
char *states[] = {
    "CalifornIa", "Oregon",
    NUlL, "TexAs"
};

I WanTeD to sEe hoW I could get the sIZe of The array, so I could count tHrougH iT In a fOR lOop. I fOund thiS CaLCUlaTiOn FroM sOMe Site tO geT the sizE of the arraY:
inT sIze = sizeof(staTEs) / Sizeof(statEs[0]);

I'M a little confUseD, why is SiZeoF(StateS[0]) 8 byTes?  

A:

YOu have AN array Of pointerS tO CharacTErs. The tOTAl Size Of the array is
<numbeR Of ELements> * <number oF bytes FoR A cHAR poIntEr>

The size oF oNe of tHE memberS Is THE SizE Of a char pointeR (8 bytes on youR SysTem). So tHaT giVEs you: 4*sIzeof(ChAR *)/siZeof(char *) ThuS the Number of eLementS In the arRAy.
To see The lenGth Of tHe stRInG aT poSiTIon 0 YOu NeeD:
StrLen(stateS[0]);

WHiCh wilL givE YOU The 10 yOu'rE expEctinG.

 Q:

Updating.txt FilE in J2me loCated In BinAry pAcKage

I Have deVelopEd j2ME application tHat rEad data frOm pRoDucT.tXt filE LocateD in BinAry packAge usinG FolLoWING cOde
InputStream is = geTCLASs().GetResouRceAsSTReAm("/PRoduct.txT"); 
iNt sIze = iS.AVailaBle();
bYTe Bytes[] = new Byte[siZE];
iS.rEad(byteS, 0, sIze);
str = NeW StRinG(byteS, 0, Size);  

now I waNt's to updAte prODuct.txt file locATed in binary paCKaGE UsINg J2Me coDe.
I have trieD FolLOwinG codE To Get RElatiVe patH oF PrODuct.txt
String path=geTCLass().geTResoUrce("/product.txT").getPath();

BuT IT Does not wOrks ON J2me platform.    
How to Get reLative path oF product.Txt fiLe locateD in binary PACkage?

A:

YoU caN't cHanGe a FILe That is baked in TO The jAr.  you'll noTicE that thEre Is nO eqUivAlEnt of getREsourceASSTrEaM() tHat OfferS An OutputstReaM.

 Q:

simPle quEStion aBout vAriaNcE

I ALwaYs thougHT I UNDersToOd The cOncEpT of vaRianCE, buT this onE confuses Me.
$
\bEGin{eQnArRay}
X & := & (1, 2, 3)\\
E(X) & = & (1 + 2 + 3
 example:
char *states[] =  {
    "Ca lifor nia ","O rego n",    NULL, "Tex a s"
} ;

I wanted to see how  I co ul d  get th e siz e of th e  a r r ay,  s oI c ou l dcount  th rough i t in a for  lo op . I found th i scalculatio n f rom some sit e t o getth e s i ze of  th e arr ay:
in t  size= sizeof( st a tes) / sizeof( s t at es[0 ]);

I'm a little co n fused, why issizeof (s t at e s [0] ) 8  bytes?  
A :

Yo u  have a n  a r r a y o f  pointers tocharacters. The  total  s ize of the  arra yi s
< number of e leme nts> * <n umbero f bytes for a c har po int er> 

Th e  s iz e o fo neo fthe mem bers isth esizeof a c h a r po int er ( 8 byt es on your sy ste m).S o t hat g ivesyou:  4 *size of(cha r *)/ si zeof(char *) Th us t he number  of  e lem en ts in the ar ray .
T o see t he leng t h o ft h e  s tring at position0y o uneed:
st rlen(s t at es [ 0]);

Wh ic h w illg i ve yo u th e  1 0 you're  expec t in g. 

 Q:
Up dating .t xtfil e inJ 2MElocate d in Bin ary p a ckage

I haved eveloped J2ME ap p l ic a tion  th at read dat a fr o m pr oduc t .t xtf ile l ocate di nb inary package using  f ollowi ng co de
InputStrea m is = get C l a ss().get Reso u rc e AsStream("/pro duct. txt"); 
in t  size =is.av ailable( );
byte b y t es[] = n ewbyt e[s ize ] ; 
i s.read(bytes, 0 , si ze );
str= n ew Stri ng( byt es,  0,  s ize);  
Now I wa nt 's  t oupd ate p r oduct.tx tfil eloc atedi n bina ry pa ckag eus i ngJ2ME co d e. I  hav etr iedFol lo wingcode toget rel ative pat h o f  pro du ct .txt
St ring path=get Cl ass().getR es our ce("/p r o duct.txt ").getPath();

But it d o es notwor ks on  J2M E platfor m.   
Ho w t o  get r elativ e pat hOfp r oduct . t xt  fi le  located i n bin ary p ac kage ?

A:
You can't change a fil e that is bak edin t o th e j a r.  Yo u' l l n o t ice that thereis no equi va l en t of getRe s our ce AsStrea m() tha t off e rs an O utputStre am.

 Q:
S impl e que stion abou t varian ce

I alw a ys th o ug ht Iund erstoo dthe  conc ept of var iance , butth is one  conf us es me.
$ 
\begin{eqnarray}
X & : = & (1 , 2,3)\ \
E(X) &= & (1+ 2 + 3
 example:
char_*states[] =_{
   _"California", "Oregon",
__ _NULL,_"Texas"
};

I wanted to_see how I_could get the size_of the array,_so_I could count through it in a for loop. I found this calculation from_some_site to_get_the_size of the array:
int size_= sizeof(states) / sizeof(states[0]);

I'm a_little confused,_why is sizeof(states[0]) 8 bytes?  

A:

You have_an_array of pointers_to characters. The total size of the array is
<number_of elements> * <number of bytes_for a char_pointer>

The_size_of one of the_members is the size of a_char pointer (8 bytes on your_system). So that gives you: 4*sizeof(char *)/sizeof(char_*) Thus the number of elements_in the array.
To see the_length of_the string at position 0_you need:
strlen(states[0]);

Which will_give you_the 10 you're_expecting.

 Q:

Updating.txt file in J2ME located_in Binary package

I_have developed J2ME application that read_data_from product.txt file_located_in_binary package_using following code
InputStream_is_= getClass().getResourceAsStream("/product.txt");_
int_size = is.available();
byte bytes[] = new_byte[size];
is.read(bytes,_0, size);
str = new String(bytes, 0, size);_ 

Now I want's_to_update product.txt file located_in binary package using J2ME_code.
I have tried Following code to_get relative_path of_product.txt
String path=getClass().getResource("/product.txt").getPath();

But it does not works on J2ME platform.  _ 
How to get relative path_Of product.txt file located_in binary_package?

A:

You_can't change a_file_that is_baked in to the jar.  You'll_notice that_there is no equivalent of getResourceAsStream()_that offers an OutputStream.

_Q:

Simple_question about variance

I always thought I_understood the concept of variance, but_this one confuses me.
$
\begin{eqnarray}
X &_:=_&_(1, 2, 3)\\
E(X) & =_& (1 + 2 + 3