Click here to Skip to main content
15,308,921 members
Home / Discussions / C#
   

C#

 
AnswerRe: Task.WhenAll ConfigureAwait Question Pin
Richard Deeming14-Oct-21 23:15
mveRichard Deeming14-Oct-21 23:15 
GeneralRe: Task.WhenAll ConfigureAwait Question Pin
Kevin Marois15-Oct-21 4:53
professionalKevin Marois15-Oct-21 4:53 
GeneralRe: Task.WhenAll ConfigureAwait Question Pin
Richard Deeming15-Oct-21 5:59
mveRichard Deeming15-Oct-21 5:59 
GeneralRe: Task.WhenAll ConfigureAwait Question Pin
Kevin Marois15-Oct-21 6:29
professionalKevin Marois15-Oct-21 6:29 
GeneralRe: Task.WhenAll ConfigureAwait Question Pin
Kevin Marois15-Oct-21 8:08
professionalKevin Marois15-Oct-21 8:08 
GeneralRe: Task.WhenAll ConfigureAwait Question Pin
Richard Deeming17-Oct-21 21:58
mveRichard Deeming17-Oct-21 21:58 
GeneralRe: Task.WhenAll ConfigureAwait Question Pin
Kevin Marois18-Oct-21 4:01
professionalKevin Marois18-Oct-21 4:01 
QuestionCodility fails to compile even though it compiles in VS code? Pin
Cliff ludo13-Oct-21 6:41
MemberCliff ludo13-Oct-21 6:41 
I have the following code which runs on VS code but not when I try to compile on codility:
C#
using System;
//using System.Linq;

static class Solution {
static int solution( int[] A ) {

    int flag = 1;
    //A = A.OrderBy(x => x).ToArray();
    Array.Sort(A);

        for (int i = 0; i < A.Length; i++)
        {
            if (A[i] <= 0)
            continue;
        else if (A[i] == flag)
        {
            flag++;
        }
    }
    return flag;
    }
    
    static void Main(string[] args) {
        
    int[] A = { 1, 3, 6, 4, 1, 2 }; 
    //int [] A ={1, 2, 3};
    //int [] A ={-1,-3};

        //var Val = A.Max();
       // if (Val < 1000000) {
        if(A.Length<99999)
        {
        int miss = solution(A);
        Console.Write(miss);       
        }
        else
        {
        Console.WriteLine(" Array is too large! ");
        }
        //}
        //else {
           // Console.WriteLine("Array Values are too big!");
        }
    }


The error I get is :

Compiler output:
Compilation failed: 2 error(s), 0 warnings
exec.cs(18,24): error CS0017: Program `exec.exe' has more than one entry point defined: `SolutionWrapper.Main(string[])'
Solution.cs(23,17): error CS0017: Program `exec.exe' has more than one entry point defined: `Solution.Main(string[])'


Runs just fine in VS code but not on codility, anyone know why?

modified 13-Oct-21 16:02pm.

AnswerRe: Codility fails to compile even though it compiles in VS code? Pin
BillWoodruff13-Oct-21 17:11
mveBillWoodruff13-Oct-21 17:11 
Generalpass array to function Pin
Cliff ludo12-Oct-21 23:04
MemberCliff ludo12-Oct-21 23:04 
GeneralRe: pass array to function Pin
Richard Deeming12-Oct-21 23:25
mveRichard Deeming12-Oct-21 23:25 
GeneralRe: pass array to function Pin
Cliff ludo12-Oct-21 23:32
MemberCliff ludo12-Oct-21 23:32 
QuestionCreating An Async Method Pin
Kevin Marois7-Oct-21 11:02
professionalKevin Marois7-Oct-21 11:02 
AnswerRe: Creating An Async Method Pin
Richard Deeming7-Oct-21 21:41
mveRichard Deeming7-Oct-21 21:41 
GeneralRe: Creating An Async Method Pin
Kevin Marois8-Oct-21 6:00
professionalKevin Marois8-Oct-21 6:00 
GeneralRe: Creating An Async Method Pin
Richard Deeming8-Oct-21 6:35
mveRichard Deeming8-Oct-21 6:35 
GeneralRe: Creating An Async Method Pin
Kevin Marois8-Oct-21 6:38
professionalKevin Marois8-Oct-21 6:38 
GeneralRe: Creating An Async Method Pin
Kevin Marois8-Oct-21 9:46
professionalKevin Marois8-Oct-21 9:46 
GeneralRe: Creating An Async Method Pin
lmoelleb9-Oct-21 0:18
Memberlmoelleb9-Oct-21 0:18 
GeneralRe: Creating An Async Method Pin
Kevin Marois9-Oct-21 7:03
professionalKevin Marois9-Oct-21 7:03 
GeneralRe: Creating An Async Method Pin
lmoelleb10-Oct-21 8:56
Memberlmoelleb10-Oct-21 8:56 
Question(xaml, wpf) ScrollViewer Binding confusion (beginner) (ANSWERED) Pin
Maximilien6-Oct-21 9:50
MemberMaximilien6-Oct-21 9:50 
SuggestionRe: (xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Richard MacCutchan6-Oct-21 21:30
mveRichard MacCutchan6-Oct-21 21:30 
GeneralRe: (xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Maximilien7-Oct-21 3:49
MemberMaximilien7-Oct-21 3:49 
AnswerRe: (xaml, wpf) ScrollViewer Binding confusion (beginner) Pin
Richard Deeming6-Oct-21 21:45
mveRichard Deeming6-Oct-21 21:45 

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.