Click here to Skip to main content
15,889,817 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to correct this warning? Pin
mybm15-Aug-14 0:17
mybm15-Aug-14 0:17 
GeneralRe: how to correct this warning? Pin
Richard MacCutchan5-Aug-14 0:22
mveRichard MacCutchan5-Aug-14 0:22 
AnswerRe: how to correct this warning? Pin
«_Superman_»5-Aug-14 1:10
professional«_Superman_»5-Aug-14 1:10 
GeneralWhat are the basic features provide by CCmdTarget?? Pin
sachanratnesh4-Aug-14 20:03
sachanratnesh4-Aug-14 20:03 
GeneralRe: What are the basic features provide by CCmdTarget?? Pin
«_Superman_»4-Aug-14 20:26
professional«_Superman_»4-Aug-14 20:26 
GeneralRe: What are the basic features provide by CCmdTarget?? Pin
sachanratnesh4-Aug-14 21:46
sachanratnesh4-Aug-14 21:46 
GeneralRe: What are the basic features provide by CCmdTarget?? Pin
Richard MacCutchan4-Aug-14 20:57
mveRichard MacCutchan4-Aug-14 20:57 
Questioncalling of function ? Pin
mybm14-Aug-14 19:17
mybm14-Aug-14 19:17 
<blockquote class="quote"><div class="op">Quote:</div>#include<stdio.h>
#include<stdlib.h>
#include<math.h>
// main.c

#include "Utility.c"
#include<dirent.h>
//#include "sample.c"
//#include "noise.c"


float* random1(int SizeOfData);
int main(void)
{
//===================random number sequences generation 

	int i,j;
	int SizeOfData=63530;
	float* squaring;
	float total_sum,summation_noise;
	float* random_seq=(float *)malloc(SizeOfData* sizeof(float ));


          random_seq=random1(SizeOfData);
		for(i=0;i<SizeOfData;i++)
			{
				printf("\t%f\n",random_seq[i]);
				
			} 
				

return 0;
}

</blockquote>

// utility.c
<blockquote class="quote"><div class="op">Quote:</div>float* random1(int SizeOfData)
{
	srand(12345); // generate same random number anytime it run
       //srand((unsigned int)time NULL)
	int i,j;
	float sum=0.0;
	float a=0.2;
	float summation_noise=0.0;

        float *y;

	y=(float *)malloc(SizeOfData* sizeof(float ));
	for(i=0;i<SizeOfData;i++)
		{
   float f= ((float)rand()/(float)(RAND_MAX))*a; //rand return integer value from 0 to RAND_MAX(system dependent)
         		
		        y[i]=f;
			//printf("\t%f\n",f);
			//printf("%f\t",((float)rand()/(float)(RAND_MAX))*a);

			
    			
               }
return y;
          </blockquote>


while running expected output has to be random float number from 0-63530
but it is displaying only one number .
AnswerRe: calling of function ? Pin
CPallini4-Aug-14 20:32
mveCPallini4-Aug-14 20:32 
GeneralRe: calling of function ? Pin
mybm14-Aug-14 20:40
mybm14-Aug-14 20:40 
GeneralRe: calling of function ? Pin
CPallini4-Aug-14 20:49
mveCPallini4-Aug-14 20:49 
GeneralRe: calling of function ? Pin
mybm14-Aug-14 20:57
mybm14-Aug-14 20:57 
GeneralRe: calling of function ? Pin
CPallini4-Aug-14 21:20
mveCPallini4-Aug-14 21:20 
GeneralRe: calling of function ? Pin
mybm14-Aug-14 20:59
mybm14-Aug-14 20:59 
GeneralRe: calling of function ? Pin
CPallini4-Aug-14 21:23
mveCPallini4-Aug-14 21:23 
GeneralRe: calling of function ? Pin
Stefan_Lang5-Aug-14 22:37
Stefan_Lang5-Aug-14 22:37 
AnswerRe: calling of function ? Pin
Satya Chamakuri13-Aug-14 20:34
Satya Chamakuri13-Aug-14 20:34 
GeneralRe: calling of function ? Pin
mybm119-Aug-14 18:13
mybm119-Aug-14 18:13 
QuestionWhich IDE is good for programming in C Pin
SHUVO BISWAS2-Aug-14 21:40
SHUVO BISWAS2-Aug-14 21:40 
AnswerRe: Which IDE is good for programming in C Pin
CPallini3-Aug-14 0:14
mveCPallini3-Aug-14 0:14 
AnswerRe: Which IDE is good for programming in C Pin
«_Superman_»3-Aug-14 3:31
professional«_Superman_»3-Aug-14 3:31 
Questionhow do i make another main.c file where i can call this program and run according to it..? Pin
mybm11-Aug-14 20:31
mybm11-Aug-14 20:31 
AnswerRe: how do i make another main.c file where i can call this program and run according to it..? Pin
Richard MacCutchan1-Aug-14 21:01
mveRichard MacCutchan1-Aug-14 21:01 
GeneralRe: how do i make another main.c file where i can call this program and run according to it..? Pin
mybm11-Aug-14 21:09
mybm11-Aug-14 21:09 
GeneralRe: how do i make another main.c file where i can call this program and run according to it..? Pin
Richard MacCutchan1-Aug-14 21:45
mveRichard MacCutchan1-Aug-14 21:45 

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.