Skip to main content

All Questions

Tagged with
0 votes
3 answers
57 views

Search for a pattern in a string array

Let's assume I have the following array: string[] arr = ["Off", "Off", "Off", "Duty", "Off", "Off", "Duty", "Duty", &...
Nean Der Thal's user avatar
-1 votes
2 answers
56 views

What is this type? And how can I return it from a function? [closed]

[FieldOffset(24)] public fixed Int32 myArray[4]; As far as I understand it should be an int array. But I'm not sure. I stumbled over this while looking over a code base which is not mine. It seems ...
MasterMax's user avatar
0 votes
1 answer
35 views

Send data to all sockets at exact time [closed]

Say we have array or list of sockets named (A,B,C) and we want to send data to all of them at the same exact time due to that the application is really time critical, then is there a away to send to ...
Akkad's user avatar
  • 641
-1 votes
2 answers
34 views

Convert this to an array to output specific positions in the array

I'm looking for converting this list to an array so I can output specific strings from there. How could I do this? Here is the code: public override void Select() { StringBuilder sb = new ...
Legois's user avatar
  • 1
2 votes
1 answer
45 views

Detect array type in source generator

I'm writing a source generator that processes my model classes and adds some custom serialisation code for them. The model classes can have all sorts of property types. I'm currently interested in the ...
ygoe's user avatar
  • 19.8k
0 votes
1 answer
34 views

Have my array be split and added on to the new array, instead of completely restarting it each loop

I have a problem with my array. Each loop, the array gets cleared and new values gets added onto it. How could I make it so as the array gets filtered, it gets added to a new array to fill it up with ...
Legois's user avatar
  • 1
-7 votes
0 answers
53 views

How To Access An Item In A Struct Which Is In An Array [closed]

I am making a tower defense game and used structs in an array and want to access an item in the structs. I don't want to use a 2d array as that can't show up in a unity editor. I tried tutorials and ...
Simon Y's user avatar
1 vote
5 answers
79 views

In C#, I'm trying to iterate strings in single loop, how?

I'm trying to achieve this output: LOWEST LOW MEDIUM HIGH HIGHEST HIGHEST HIGH MEDIUM LOW LOWEST I know there are many ways to do it, but I'm trying it in single loop, is it achievable? My code is ...
Norvz's user avatar
  • 27
2 votes
1 answer
61 views

C# generic method detect if T is array and then index into the array

I'm trying to write a Dbg debug function that will print out some debug info about the given parameter and then return it. I would like arrays to be printed as the list of elements, and scalars to ...
beyarkay's user avatar
  • 809
0 votes
1 answer
74 views

C# inserting a value at the end of the array befroe sending it through the serial port

I have a problem and need your help please. I have an array and a textbox, the user will enter a decimal value of maximum 32 bits in the textbox. This value needs to be added at the end of the array ...
Mustapha Alkhafaaf's user avatar
0 votes
1 answer
40 views

c# HttpWebRequest response string array object parsing error

I want to parse http request response into myDATA class. But gives me error My codes under below. Im using also NEWtonsoft.Json public class myDATA { [JsonProperty("data1")] ...
Noucoder's user avatar
0 votes
0 answers
58 views

Why ToJson saves only {}? [duplicate]

Before this, I saved only one instance of the class in Json, and everything worked. Now when I try to save the whole array, nothing works for me. Please don't advise me to switch to some Newtonsoft. ...
Матвей Тинин's user avatar
0 votes
1 answer
39 views

Rotate - Getting the outer circle of a square array

I'd like to get the outer of a square array. for example:the input is: 3 4 3 1 6 5 2 9 7 3 the output is 1 2 3 3 5 7 4 6 9 The original data was rotated 90 degrees to the right/clockwise.(the first ...
Flora Jiang's user avatar
1 vote
1 answer
87 views

Find errors: Array - wrong output

I'm writing string[] to show multiple rows in the output. A stupid question, why the output is not 5 x 5?(I used i and j both from 0-4, then the ouput should be an array 5 x 5), can anyone help? <...
Flora Jiang's user avatar
1 vote
0 answers
40 views

"Not all code return a value" when loop returns [duplicate]

I'm a coding beginner and have a question on how to return to an array in C#. When I wrote the code, it popped out an error msg "not all code return a value". [HttpGet] [Route("api/J3/...
Flora Jiang's user avatar

15 30 50 per page
1
2 3 4 5
1179