Posts by Pedro Santos • 141 points
7 posts
-
1
votes1
answer591
viewsA: Doubt in code in C!
Putting (int) before a variable returns only the whole part of the number (without rounding it), so in the second print it showed only the whole part, so I explained, in the third printf subtracted…
-
3
votes3
answers608
viewsA: Read a console line in C#
You can write that conversion line this way: int age = int.Parse(Console.ReadLine());
-
0
votes1
answer23
viewsQ: For with Datetime in Razor giving out of memory Exception
I am having out of memory error, being it caused by this Razor code in my cshtml file, and can’t identify where the problem is. @for(DateTime data = DateTime.Today.Date; data <=…
-
-1
votes1
answer57
viewsQ: How to do this in LINQ?
I spent the day looking for how LINQ works and tried to use in a little project I’m using to study, after a long time trying the code using LINQ became like this: for (var dia = comeco.Date;…
c#asked Pedro Santos 141 -
1
votes2
answers684
viewsA: Problems assigning values to variables in an object
You need to create a constructor method, the constructors are responsible for creating the object in memory, ie instantiating the class that has been defined. They are mandatory and are declared…
-
2
votes1
answer333
viewsA: Haskell- List replacement function
If you need to change elements in a given index, lists are not the structure for this. You could use Seq of Data.Sequence, in which case the function you are looking for is update :: Int -> a…
haskellanswered Pedro Santos 141 -
6
votes2
answers791
viewsQ: How does the Sort method work?
I’m starting to learn javascript and while searching for examples of Sort I came across the following code: var numeros = [1,2,3,4,5,6,7,8,9,10]; numeros.sort(function (a, b) { return (a % 2 !=0);…
javascriptasked Pedro Santos 141