[Solved] Getting error C2440

[ad_1] You cannot use: strcpy(Student.StudentGPA, “2.4”); strcpy(Student.StudentCredits, “31”); since Student.StudentGPA and Student.StudentCredits are of type double. Use: Student.StudentGPA = 2.4; Student.StudentCredits = 31; BTW, the line strcpy(Student.StudentMajor, “TECH”); will lead to undefined behavior since Student.StudentMajor doesn’t have enough space to hold those characters and a terminating null character. Make the size of Student.StudentMajor at least … Read more

[Solved] call to ‘pow’ is ambiguous

[ad_1] The error means there is not a version of the function which takes the type you are passing, but instead there are more than one version taking a type that could be converted to (like float and double). The compiler doesn’t know which you want. There is not an int version of this function, … Read more

[Solved] Cannot get pointers result

[ad_1] I can only assume, that an expected behavior is to get variable v incremented 10 times using pointer. If that’s correct, you have two mistakes: Type of pointer should be the same with the data you’re pointing. If you’re pointing at int variable, you should use int * pointer. In the for loop condition: … Read more

[Solved] Obfuscated code in C and what does this program code [closed]

[ad_1] This is an obfuscated, miniature Raytracing program. It is described on site https://mzucker.github.io/2016/08/03/miniray.html I found it by taking part of the mystery string “LJFFF%7544x^H^XXHZZXHZ”, and googling for it. If you run the compiled program and capture the output, you get a raytraced picture in .PPM format: a.out > output.ppm When I tried to run … Read more

[Solved] ‘ ‘ was not declared in this scope [closed]

[ad_1] If you want to implement the dynamic array management within a class, you need to qualify your method implementations with the class name. dynamicArray.cpp int * dynamicArray::array_constructor(int * &intPtr, int &size ){ if(intPtr != NULL){ // … other member functions the same thing. However, you don’t really use your class in a class-like way … Read more

[Solved] asp net. How to remove data from a database

[ad_1] Steps Get the user – ideally you want to use the userid (or primary key) to retrieve the user Remove the user from the db Save the changes in the context Code: var user = db.Users.Single(x => x.Nom == formUser.Nom && x.prenom == formuser.prenom); db.Users.Remove(user); db.SaveChanges(); [ad_2] solved asp net. How to remove data … Read more

[Solved] What is the difference between these for loops? [closed]

[ad_1] This is the line I’m having a problem with for(int i = a; i &lt= b; i++) { /* body of the loop */ } See e.g. https://en.cppreference.com/w/cpp/language/for, it translates into something like: Executes int i = a; once, then executes the body of the loop and i++ repeatedly, until the value of condition … Read more

[Solved] c# prevent duplicating forms [closed]

[ad_1] This should work (haven’t tested it though) public static bool _Invoked; Form2 f2 = new Form2(); private void button1_Click(object sender, EventArgs e) { if (!_Invoked) { _Invoked = true; f2.Show(); } else if (_Invoked) { f2.BringToFront(); _Invoked = false; } } Add a comment for further clarification EDIT: Just tested this and its working … Read more

[Solved] Integers and while loop in C++… how?

[ad_1] Depending on how you define and initialize x, it may go into the loop every time you enter a non-integer, or it may only go into the loop sometimes. If you don’t assign any value to x, then the value of x is still undefined after cin >> x if you enter a non-integer, … Read more