[Solved] In plain C, without using strlen or any library function that uses strlen, how do you find whether one string is contained in another?

Removing the variable flag is deceptively easy by the way, as the only cases (using your algorithm as shown) where your function should return true is if either s1 is empty or the condition !*c is true. In all other cases it should return false. So your function, without any other modifications, could easily be … Read more

[Solved] Rearrange the autoincrement column value after deleting some rows

When you have declared the column as INTEGER PRIMARY KEY, you don’t need to do anything because the database automatically uses the next value after the largest value in the table. When you have declared the column as INTEGER PRIMARY KEY AUTOINCREMENT, the current counter is stored in the sqlite_sequence table. You can simply modify … Read more

[Solved] Issue with substr C++

As mentioned you can’t call substr() with a std::ifstream. What you probably meant was to take the parts from the line string read in a[i]= stoi(line.substr(4,2)); name[i]= line.substr(18,15); b[i]= stoi(line.substr(36,1)); Also note you’ll need to convert the substrings extracted to a number (instead of assigning them directly), hence I have added the stoi(). As also … Read more

[Solved] what is the order of execution if I put a statement after the statement that do the recursion inside the function

okay it’s really simple. Just consider these two points before moving on: point 1: When a function calls another function, the first function that calls the other is known as the “caller” function, the function getting called is known as the “callee”. point 2: when a callee is called, code execution stops at the point … Read more

[Solved] How to find the largest and smallest element in C using arguments and array? [closed]

#include <stdio.h> #include <stdlib.h> int main(int iics, char*argv[]){ int a,n=0,sum=0,average,highest,lowest,num[100]; for (a=1; a<iics; ++a) sum = sum + (num[n++] = atoi(argv[a])); printf (“The sum is %.2d \n”, sum); average = sum / n; printf (“The average is %.2d \n”, average); highest = num[0]; lowest = num[0]; for (a = 1; a < n; ++a){ if(num[a] … Read more

[Solved] iterating over cases in c++ switch statement? [closed]

It’s possible. You’ve accidentally written an infinite loop because you’re not incrementing x, which you probably want to do after the switch. But if you just want to run those 3 blocks of code in that order, why not just have those 3 blocks of code in that order? You gain absolutely nothing by wrapping … Read more

[Solved] Qt c++ incorrect class access

You have defined the Test() function in the header for the class coreEng, but failed to implement the class. At the very least, you can put braces at the end of the definition in the header file: – void Test() {} Or implement the function in the cpp void coreEng::Test() { // perform test } … Read more

[Solved] Adding new item in Visual studio 2010 [closed]

Being that you used the term “Master Page”, I’m going to assume this is an ASP.NET Web Forms project. Think of a Master Page as an abstract class. You cannot view it directly, but implement it in your pages. Check out this beginner tutorialhttp://www.codeproject.com/Articles/333650/Beginner-s-Tutorial-on-Master-Pages-in-ASP-NET solved Adding new item in Visual studio 2010 [closed]