[Solved] VS2017 “non-standard syntax; use ‘&’ to create a pointer to member ” [closed]

On the line cout << “BySimpson:” << MyInt.BySimpson << endl << endl; You probably meant to make a call to BySimpson but your forgot the () cout << “BySimpson:” << MyInt.BySimpson() << endl << endl; The reason you get this misleading error is because pre ISO standarization MyInt.BySimpson would actually mean you wanted the address … Read more

[Solved] While loop won’t continue

I don’t understand what the purpose of cin is here, but if you want the output you requested in the question: // Example program #include <iostream> #include <string> using std::cout; using std::endl; int main() { int Day = 20; while (Day >= 1) { cout << Day << ” “; Day /= 2; } } … Read more

[Solved] how to use strcmp in g++

The problem isn’t on the function but on the way that you’re using it. int strcmp ( const char * str1, const char * str2 ); strcmp takes two const char * arguments. The error tells you that you are giving the function a char so the problem is on the types of personalNo and/or … Read more

[Solved] Pointers give seg fault [closed]

You have not assigned anything to the pointers to the Paddle, Ball or Manager variables in your main method. By default the won’t be initialised and will point somewhere in memory, which may or may not be accessible to your application. When you access them and the memory is inaccessible you get the access violation … Read more

[Solved] C++ error expected unqualified [closed]

You are placing semi colons at the end of your functions params list For example: int substract(int a,int b); —> (Should not have a semi-colon here) { return (a-b); } Whenever C++ compiler throws an unexpected unqualified at you, it is usually in part because your semi-colons are incorrect. This is good to remember for … Read more

[Solved] Is this a constructor (C++)

The class has only one constructor Test (int x = 0, int y = 0) { this->x = x; this->y = y; } that is the default constructor because it can be called withoit arguments.. The constructor name is the same as the class.name. So these Test setX(int a) { x = a; return *this; … Read more

[Solved] Getting incorrect timings while calculating difference between 2 datetime

As has been commented on – the problem is due to the millisecond accuracy. You can subtract the millisecond by adding the negative of the milliseconds: DateTime end = new DateTime(2018, 04, 13, 12, 17, 39, 067); DateTime start = new DateTime(2018, 04, 13, 12, 17, 38, 893); var diff = end.AddMilliseconds(-end.Millisecond) – start.AddMilliseconds(-start.Millisecond); string … Read more

[Solved] Async Wait issues with view updation in UWP

Since calling Bindings.Update() fixed your issue, your binding expressions should be correct, but somehow the property change notification fails. I am not going to guess what really went wrong here but to explain when you should be using Bindings.Update(), and when you should be using INPC + OneWay bindings. Bindings.Update() is only available for x:Bind, … Read more

[Solved] Rock paper scissor program

I have highlighted the basic problems below. You can probably change your code to use better idioms but for the following should be sufficient for now. You are comparing characters with const char* values, this is ill formed code. String literals in C++ of the form “__characters__” are of the type const char*, and it … Read more

[Solved] C# Argument 1: cannot convert from ‘void’ to ‘bool’ [closed]

Remember: void means your method doesn’t return a value, so it cannot be assigned to other variable or passed to method as an argument like WriteLine method: this is what you’re looking for: class Program { static void Main(string[] args) { Console.WriteLine(“what is num?”); int num = int.Parse(Console.ReadLine()); downnums(num); } public static void downnums(int num) … Read more

[Solved] What does this line of code mean

This is not standard C++ program. Zero size arrays are not allowed in C & C++. You should use -pedantic-errors command line option if you are using g++ & clang++ compiler to strictly confirm to the standard & disable any compiler extensions. See live demo here. Clang++ says source_file.cpp:7:14: error: zero size arrays are an … Read more

[Solved] Add row and fill value in dataGridView C#

Having first loaded your DataGridView you then need to pass the DataTable that was the initial source through to a method that looks similar to this: private void addExtraRows(DataTable dT) { DataTable newTable = dT.Clone(); DataRow nR; int lastRow = dT.Rows.Count – 1; for (int i = 0; i < lastRow; i++) { if (dataGridView3.Rows[i].Cells[1].Value.ToString() … Read more

[Solved] Invalid use of void expression in strcmp

It looks like you want to compare strings after sorting. Assuming your sort function does the right thing, you need to compare the strings after sorting them. sort(string1); sort(string2); val = strcmp(string1, string2); The reason for the error is that your sort function returns void. So you are effectively passing void arguments to strcmp. And … Read more

[Solved] why < is much faster than !=?

When you call cycle with the input value 113383, the process eventually sets n to 827370449, and 3*827370449+1 is 2482111348, which is greater than the maximum signed int and is interpreted as -1812855948. So there’s your first negative number where there should be no negative number. If this process then eventually sets n to -2, … Read more

[Solved] Deleting on array item in Windows Phone C# app and never show it in next app launch [closed]

Pretty basic example of using storage folder with xml output/input. You can modify it do what you wish. I use a more complicated version of it for my own windows phone app. I’m assuming you having a hard time writing and reading the data back. If you need help deleting a random element from the … Read more