I do not know why? one program works with srand(time(NULL)); , but the other one not working. What do I need to make srand(time(NULL)) work ? Please help.
mrby123
Posts
-
how to make this working: srand(time(NULL)); -
debug begining: Unhandled exception at 0x77cf15de in blast_vib_proc.exe: 0xC00000FD: Stack overflow.'blast_vib_proc.exe': Loaded 'D:\DATA\fragmentation_model\Debug\blast_vib_proc.exe', Symbols loaded. 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\msimg32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\comdlg32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\shlwapi.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\shell32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\winspool.drv', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\oledlg.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\SysWOW64\oleacc.dll', Cannot find or open the PDB file 'blast_vib_proc.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.17825_none_72d2
-
as soon as start program got error message - stack overflowAs soon as start program, not operate on any array yet, got error message: Unhandled exception at 0x77c315de in blast_frag.exe: 0xC00000FD: Stack overflow. Please help why ? Thanks
-
error from using CString.GetBuffer (MAX_PATH),CString ftitle; fscanf_s(f_ptr_seed_inf,"%s\n",ftitle[ifl].GetBuffer(MAX_PATH)); ftitle[ifl].ReleaseBuffer(); I got error message: Unhandled exception at 0x776015de in MSW_Vib_Model.exe: 0x00000000: The operation completed successfully. Please help
-
reading errorI got this error message when I debug: Unhandled exception at 0x77a915de in MSW_Vib_Model.exe: 0x00000000: The operation completed successfully. from these code segments: // ifl=0; do { { // fscanf_s(f_ptr_seed_inf,"%lf %lf %s\n",&sd_dis[ifl],&time_onset[ifl], ftitle[ifl].GetBuffer(MAX_PATH)); ftitle[ifl].ReleaseBuffer(); } ifl += 1; } while (!feof(f_ptr_seed_inf)&&(ifl<120)); nfile=ifl; // This is my input file: 4171.000 0.28600 ECO61_4171_Hole1_seeds.txt 4157.000 0.24600 ECO61_4157_Hole2_seeds.txt Please help me.
-
MSDN 2010, scanf_sHow to spacify the width of a string in 'scanf_s' ? I feel hard, since the width of the string in the input file is not fixed varying from 50 character to 120, so how to specify the buffer size. I used 'scanf' to read input, I do not need to specify the length of the string. Please advise. Thanks
-
'fopen_s' and 'fscanf_s'Hi Gurus, Could you provide me some codes examples to use: 'fopen_s' and 'fscanf_s'. Thanks
-
srand(time(NULL)); in MSDN 2010I got the following compile error message, for using: srand(time(NULL)); warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data Thanks
-
code pow(a,b) function in Visual studio 2010 professionalthank you, really helped me.
-
msdn 2010 professional - read double formatIt seems that the following format "%f\n" for reading a double not working. Please help: fscanf( f_ptr_seed_inf,"%f\n",&sam_interval); Thanks
-
code pow(a,b) function in Visual studio 2010 professionalThank you for your helpful correction. If I change all 'float' type to double, my program would be too large. How about change all types to 'float' ? Thanks
-
code pow(a,b) function in Visual studio 2010 professional1>c:\msw_give_out\void_effect_no_input_msw_shotplus_i_format\blast_vib_procdlg.cpp(1908): error C2666: 'pow' : 6 overloads have similar conversions 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(583): could be 'long double pow(long double,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(581): or 'long double pow(long double,long double)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(535): or 'float pow(float,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(533): or 'float pow(float,float)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(497): or 'double pow(double,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(122): or 'double pow(double,double)' 1> while trying to match the argument list '(float, double)' 1>c:\msw_give_out\void_effect_no_input_msw_shotplus_i_format\blast_vib_procdlg.cpp(1909): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data 1>c:\msw_give_out\void_effect_no_input_msw_shotplus_i_format\blast_vib_procdlg.cpp(1923): error C2666: 'pow' : 6 overloads have similar conversions 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(583): could be 'long double pow(long double,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(581): or 'long double pow(long double,long double)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(535): or 'float pow(float,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(533): or 'float pow(float,float)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(497): or 'double pow(double,int)' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(122): or 'double pow(double,double)' 1> while trying to match the argument list '(float, double)' How to fix the error? Thanks
-
migration from c++ 6 to Visual stutio professional 2010thanks, that is useful to me.
-
migration from c++ 6 to Visual stutio professional 2010Gurus, Please help on this warnning message when I built: 1>d:\test\blast_vib_proc_new\blast_vib_procdlg.cpp(211): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen' 1>d:\test\blast_vib_proc_new\blast_vib_procdlg.cpp(223): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'
-
migration from c++ 6 to Visual stutio professional 2010Thanks Guys.
-
migration from c++ 6 to Visual stutio professional 2010thanks a lot. Do I have to install visual studio 2008 for converting my visual c++ 6 (2003) ? Please give me some guidances. hanks again
-
migration from c++ 6 to Visual stutio professional 2010I need to convert my programs from c++ 6 to Visual stutio professional 2010. Please advise how to proceed and what I need to fix typically ? What is the best way to do this ? Thanks Ruilin
-
assertion failureThanks for all guys who made suggestion above. When I debug I got error message: "user break point called from code at 0x7c90120e" -> 7C90120E int 3 Please help, Thanks
-
assertion failureWhen I run my program I got: Debug Assertion Failed! Program: F:\Debug\abvb.exe File: dbgheap.c Line:1044 Expression: _CrtIsValidHeapPointer(pUserData) Please give me a direction on how to find the problem. Thanks
-
subroutine to solve linear algebraic equations - fewer unknowns than equationsThanks for the useful comments. Yes, the subroutine would check the linear - dependency between equations and exclude those redundent equations. Yes, a least square technique is required to fine the mean and standard deviations.