dynamic

Some code of reading .csv file crashed

ⅰ亾dé卋堺 提交于 2020-01-07 02:13:34
问题 I tried make a code to read a csv file and change one value by getting line and column. In the first I read the file to check how many lines and cols up there, and than I create a dynamic 2D array- every line is the line on the file. actually make the file in 2D array. and than I will change the value of the chosen line and col and write the whole array back to the file. someone know why it's crashed? it's crashed in the first line of - bigArr[i][j]=(char)ch; the function: int changeValue(int

JQuery/PHP Dynamic Dropdown Issue

你说的曾经没有我的故事 提交于 2020-01-07 02:01:07
问题 I've been building a script for dynamic dropdowns using PHP and JQuery and I'm having an issue with some of the data being sent from the form to be queried. Basically the user will choose an option from the first box and from there ever other box is dependent on the previous. The options are pulled from a MySQL database and as these same options are being picked they are sent back to the script to create the next query and so on. I'm having issues with some of the data and I think it's

Memory Leak with no dynamic memory

て烟熏妆下的殇ゞ 提交于 2020-01-07 00:08:18
问题 I was wondering if you you could have a memory leak on the heap without having any dynamic memory allocated. However, I do have three vectors declared and initialized. Is it because I need to deallocate the vector before I close the program. 回答1: I just found the problem, it was the exit function that I was using to close the program. exit does not call the destructors of any stack based objects so if those objects have allocated any memory internally then yes that memory will be leaked.

Dynamic Binding Java. Does an object have the methods of its declared type, or its actual type? [duplicate]

风格不统一 提交于 2020-01-06 19:06:49
问题 This question already has answers here : Difference between Dynamic and Static type assignments in Java (5 answers) Closed 4 years ago . Say I declare the following: Cat elsa = new Lion(); Lion extends Cat. If I declare it this way, will elsa be a cat having All of the methods of a cat or will it be a Lion, having all of the methods of both lion and cat This exact question is not addressed in other questions that I could find. 回答1: The object you create is of type Lion and has all of the

Dynamic Binding Java. Does an object have the methods of its declared type, or its actual type? [duplicate]

纵饮孤独 提交于 2020-01-06 19:06:09
问题 This question already has answers here : Difference between Dynamic and Static type assignments in Java (5 answers) Closed 4 years ago . Say I declare the following: Cat elsa = new Lion(); Lion extends Cat. If I declare it this way, will elsa be a cat having All of the methods of a cat or will it be a Lion, having all of the methods of both lion and cat This exact question is not addressed in other questions that I could find. 回答1: The object you create is of type Lion and has all of the

I've got a segmentation fault but I dont find oO?

妖精的绣舞 提交于 2020-01-06 18:08:24
问题 It should sort with merge. There are two functions the merge and the sort merge. Some not known functions (read array from file and print array) are totally functional in an input file. Valgrind show me that the failure is at the allocation from array2 and when it read and write at the 3rd while-loop in void merge. void merge(int* array, int start, int middle, int end) { int size = end - start + 1; int *array2 = malloc(size*sizeof(array2)); int k = start; int m = middle + 1; int i = 0; int j

C++: How to let the indexes of an dynamic array be determined by lines in a file

只愿长相守 提交于 2020-01-06 17:45:58
问题 I'm trying to make three dynamic arrays whose indexes are determined by the number of lines in a text file. I then need to make their index values modifiable. I was thinking that global arrays would be my best bet. For some reason I keep receiving the following compiler error: secondLab.obj : error LNK2019: unresolved external symbol "void __cdecl arrayInput(...) Question, how do I fix this and basically meet the goal of my program. Here's my code: #include <iostream> #include <fstream>

How to dynamically create customized TabSheet runtime

女生的网名这么多〃 提交于 2020-01-06 16:33:02
问题 I would like to create a TTabsheet which has to be create during run time. The TTabSheet has several components, but all of these components will be identical on every tab. Is it possible to create a "type" variable which will create these tabs every time? Thanks 回答1: Yes. You could create inherited class from TTabSheet TCustomTabSheet = class(TTabSheet) public constructor Create(AOwner : TComponent); override; public FTestButton : TButton; end; constructor TCustomTabSheet.Create(AOwner :

How to dynamically create customized TabSheet runtime

…衆ロ難τιáo~ 提交于 2020-01-06 16:31:21
问题 I would like to create a TTabsheet which has to be create during run time. The TTabSheet has several components, but all of these components will be identical on every tab. Is it possible to create a "type" variable which will create these tabs every time? Thanks 回答1: Yes. You could create inherited class from TTabSheet TCustomTabSheet = class(TTabSheet) public constructor Create(AOwner : TComponent); override; public FTestButton : TButton; end; constructor TCustomTabSheet.Create(AOwner :

WPF ToolTip Style with dynamic LayoutTransform

坚强是说给别人听的谎言 提交于 2020-01-06 15:20:10
问题 I have an app that scales it's UI and I want to scale the ToolTips with it. I have tried doing this: <Style TargetType="{x:Type ToolTip}"> <Setter Property="LayoutTransform" Value="{DynamicResource scaleTransf}"/> ... </Style> ...where scaleTransf is a resource that I change via code: Application.Current.Resources["scaleTransf"] = new ScaleTransform(...); with: <ScaleTransform x:Key="scaleTransf" ScaleX="1" ScaleY="1"/> Most of the ToolTips do get scaled in size but some of them that are