Click here to Skip to main content
15,899,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question'sprintf': cannot convert parameter 1 from 'TCHAR *[1024]' to 'char *' Pin
Swap95-Aug-14 1:33
Swap95-Aug-14 1:33 
AnswerRe: 'sprintf': cannot convert parameter 1 from 'TCHAR *[1024]' to 'char *' Pin
«_Superman_»5-Aug-14 2:04
professional«_Superman_»5-Aug-14 2:04 
GeneralRe: 'sprintf': cannot convert parameter 1 from 'TCHAR *[1024]' to 'char *' Pin
Swap95-Aug-14 3:43
Swap95-Aug-14 3:43 
GeneralRe: 'sprintf': cannot convert parameter 1 from 'TCHAR *[1024]' to 'char *' Pin
Swap96-Aug-14 1:31
Swap96-Aug-14 1:31 
GeneralRe: 'sprintf': cannot convert parameter 1 from 'TCHAR *[1024]' to 'char *' Pin
«_Superman_»6-Aug-14 20:22
professional«_Superman_»6-Aug-14 20:22 
AnswerRe: 'sprintf': cannot convert parameter 1 from 'TCHAR *[1024]' to 'char *' Pin
CPallini5-Aug-14 2:36
mveCPallini5-Aug-14 2:36 
GeneralRe: 'sprintf': cannot convert parameter 1 from 'TCHAR *[1024]' to 'char *' Pin
Swap95-Aug-14 3:50
Swap95-Aug-14 3:50 
GeneralRe: 'sprintf': cannot convert parameter 1 from 'TCHAR *[1024]' to 'char *' Pin
Richard MacCutchan5-Aug-14 5:32
mveRichard MacCutchan5-Aug-14 5:32 
Questionhow to correct this warning? Pin
mybm15-Aug-14 0:02
mybm15-Aug-14 0:02 
AnswerRe: how to correct this warning? Pin
Richard MacCutchan5-Aug-14 0:08
mveRichard MacCutchan5-Aug-14 0:08 
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 

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.