Click here to Skip to main content
15,922,533 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: regarding AVCODEC Pin
Girish Kumar3-Jan-08 18:41
Girish Kumar3-Jan-08 18:41 
GeneralRe: regarding AVCODEC Pin
Girish Kumar4-Jan-08 22:07
Girish Kumar4-Jan-08 22:07 
GeneralRe: regarding AVCODEC Pin
Girish Kumar5-Jan-08 20:23
Girish Kumar5-Jan-08 20:23 
GeneralTemplate and operator Pin
Vics3-Jan-08 0:53
Vics3-Jan-08 0:53 
GeneralRe: Template and operator Pin
CPallini3-Jan-08 2:08
mveCPallini3-Jan-08 2:08 
GeneralRe: Template and operator Pin
Vics3-Jan-08 2:49
Vics3-Jan-08 2:49 
Questionhow to modify these matrix? Pin
gentleguy3-Jan-08 0:39
gentleguy3-Jan-08 0:39 
AnswerRe: how to modify these matrix? [modified] Pin
CPallini3-Jan-08 0:57
mveCPallini3-Jan-08 0:57 
li zhiyuan wrote:
from above, i can get 10 3x4 matrix, but they are all same values, so how to do they will be random?


because rand() is evaluated once, and the returned value used to initialise all of the matrix elements.
see David Crow point [^].


li zhiyuan wrote:
by the way, how to brief definition of array a?


To solve both problems, to compact source code, assign dynamically the matrix elements, i.e.

for (i=0; i<3; i++)
  for (j=0; j<4; j++)
    a[i][j] = (double)rand()/RAND_MAX;

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

[my articles]


modified on Thursday, January 03, 2008 9:18:29 AM

QuestionRe: how to modify these matrix? Pin
David Crow3-Jan-08 2:58
David Crow3-Jan-08 2:58 
GeneralRe: how to modify these matrix? Pin
CPallini3-Jan-08 3:18
mveCPallini3-Jan-08 3:18 
GeneralRe: how to modify these matrix?[modifed 4/01/08] Pin
gentleguy3-Jan-08 14:43
gentleguy3-Jan-08 14:43 
GeneralRe: how to modify these matrix?[modifed 4/01/08] Pin
David Crow3-Jan-08 15:50
David Crow3-Jan-08 15:50 
GeneralRe: how to modify these matrix?[modifed 4/01/08] Pin
CPallini3-Jan-08 20:59
mveCPallini3-Jan-08 20:59 
AnswerRe: how to modify these matrix? Pin
David Crow3-Jan-08 2:47
David Crow3-Jan-08 2:47 
AnswerRe: how to modify these matrix? Pin
Randor 3-Jan-08 6:51
professional Randor 3-Jan-08 6:51 
GeneralRe: how to modify these matrix? Pin
CPallini3-Jan-08 7:23
mveCPallini3-Jan-08 7:23 
GeneralRe: how to modify these matrix? Pin
Randor 3-Jan-08 7:33
professional Randor 3-Jan-08 7:33 
GeneralRe: how to modify these matrix? Pin
CPallini3-Jan-08 7:52
mveCPallini3-Jan-08 7:52 
GeneralRe: how to modify these matrix? Pin
gentleguy3-Jan-08 14:36
gentleguy3-Jan-08 14:36 
GeneralA project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
cuesdean florin3-Jan-08 0:38
cuesdean florin3-Jan-08 0:38 
QuestionRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
Matthew Faithfull3-Jan-08 1:02
Matthew Faithfull3-Jan-08 1:02 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
cuesdean florin3-Jan-08 1:34
cuesdean florin3-Jan-08 1:34 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
Matthew Faithfull3-Jan-08 1:56
Matthew Faithfull3-Jan-08 1:56 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
cuesdean florin3-Jan-08 4:10
cuesdean florin3-Jan-08 4:10 
GeneralRe: A project made from XPCOM components and VC++ - I posted this messaje before several hours ago Pin
Matthew Faithfull3-Jan-08 4:19
Matthew Faithfull3-Jan-08 4:19 

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.