[Solved] Chasing game in C [closed]

It is an interesting problem. Let’s go over the rules again. Players Chicken: takes shortest path to field (there could be multiple shortest paths) and away from eagle (maximise the distance between itself and eagle among shortest paths). Eagle: takes shortest path to chicken To solve the problem we have to assume it is played … Read more

[Solved] Call the maximum from SQL table to textbox

You could design your database table using an IDENTITY column. The database will assign a next value for the inserted row. You can access the value using one of: SCOPE_IDENTITY, @@IDENTITY or IDENT_CURRENT. More can be found here: MSDN-Identity. To know the difference between SCOPE_IDENTITY and @@IDENTITY see here. solved Call the maximum from SQL … Read more

[Solved] Is string check returns false

To meet your method name, you need this: protected bool IsStringAndNotNullAndEmpty(object value) { var s = value as string; return s == string.Empty; } Changing its name to IsEmptyString(object value) would be clearer though. It seems the OP actually wants a method that returns true for non-empty strings. So what is required is: protected bool … Read more

[Solved] Program keeps returning Segmentation Fault [closed]

(1) isalpha(argv[1]) is wrong. This function expects a single character, but you are passing a pointer-to-string. That will certainly not give you any kind of expected result, and it’s probably Undefined Behaviour into the bargain. You either need to loop and check each character, use a more high-level library function to check the entire string, … Read more

[Solved] How to get my external ip (primary interface) without internet connection, without eth0 and without any hardcoded constnts using C [closed]

If you just want to discover the default adapter’s assigned IP address, e.g. 192.168.0.237, call getifaddrs and enumerate each address. This is the same list of adapters that ifconfig would normally display with associated information for gateway and netmask. Filter out the ones that are flagged as IFF_LOOPBACK or don’t have IFF_UP. Some sample code … Read more

[Solved] Switch statement to IF/while [closed]

if(ulDataBuf!=15 && ulData==15) { if(ulDatabuf == 14) { timeON+=500000; } else if(ulDatabuf == 13) { if(timeON!=0) { timeON-=500000; } } else if(ulDatabuf == 11) { timeOFF+=500000; } else if(ulDatabuf == 7) { if(timeOFF!=0) { timeOFF-=500000; } } } 1 solved Switch statement to IF/while [closed]

[Solved] Point and triangle

You are trying to compare double with operator==. The calculations may differ, you need to use an epsilon value for a mistake margin: const double Epsilon = 0.0001; if (((s1+s2+s3) >= s4 – Epsilon) && ((s1+s2+s3) <= s4 + Epsilon)) { } 3 solved Point and triangle