[Solved] Overwhelmed with how to accomplish program

You can try this … printf(“Please enter a character or characters “); while (c !=’\n’) { c = getch(); // Check for a digit if isdigit(c){ sum += c – ‘0’; continue; } // If lowercase, convert to upper case if islower(c) c = toupper(c); if isupper(c) putchar(c); } EDIT: Actually the continue isnt necessary … Read more

[Solved] C# in Visual Studio [closed]

You may start with the largest number first, something like: foreach(number in positiveNumberArray) { if (number > 50) Console.WriteLine(“Out of Range”); else if(number > 40) Console.WriteLine(“Range 40-50”); else if(number > 30) Console.WriteLine(“Range 30-40”); else if(number > 20) Console.WriteLine(“Range 20-30”); else if(number > 10) Console.WriteLine(“Range 10-20”); else Console.WriteLine(“Range 0-10”); } Edit: To count the up the … Read more

[Solved] Expected expression before ‘]’ token? C [closed]

You have not specified what element of the array item you are trying to pass to the function. item[] doesn’t mean anything. It has no value. You have to put a number into the brackets. That number is the element of the array. Each element of an array has its own value. Example broken code … Read more

[Solved] Best Approach For CRUD [closed]

You certainly can. It surely will vary from one provider to another. You can take a peek into how MySql .Net Connector is implemented over here. This raises the question, why would you want to do that? Providers give you a standard API your application can depend on. That allows you to switch a provider … Read more

[Solved] can i check content of values that have been push_back to a vector? [closed]

Maybe you could use one of the containers, e.g. vector. you could push_back all the moves into this vector until home is reached. The size of this vector will be the number of moves. You can setup a counter array[400] for counting the number of moves into same coordinates. For each move, – `push_back` the … Read more

[Solved] Need help in converting C++ to javascript

It means that their previous programmer loved being “clever”. The value of an assignment is a reference to the object that was assigned to, and assignment associates to the right. –(it1 = it2 = it3) is –(it1 = (it2 = it3)) and it’s intended to assign the value of it3 to it2 and it1, then … Read more

[Solved] how to decleare a 1D double array

Try this After taking the input in variable line do this: #include<iostream> #include<string> #include<sstring> using namespace std; void main() { bool flag=true; unsigned n,i=0; double x; string line,str; istringstream iss; cout<<“input your ” getline(cin,line); int c=0; char * pch; pch = strtok (line,” ,”);// this will work for space and comma but you can add … Read more

[Solved] Saving values from arraylist to txt C# [closed]

static void SaveArray() { ArrayList myArray = new ArrayList(); myArray.Add(“First”); myArray.Add(“Second”); myArray.Add(“Third”); myArray.Add(“and more”); StreamWriter sw= File.CreateText(@”C:\file.txt”); foreach (string item in myArray) { sw.WriteLine(item); } sw.Close(); } and you shouldn’t use arraylist not because its 2013 ,but because arraylist boxing each item in the array, where List store the type also. this cost less in … Read more

[Solved] getopt adding extra functionality in C

Taken directly from the GNU C Library Reference page on getopt: while ((c = getopt (argc, argv, “abc:”)) != -1) switch (c) { case ‘a’: aflag = 1; break; case ‘b’: bflag = 1; break; case ‘c’: cvalue = optarg; break; case ‘?’: if (optopt == ‘c’) fprintf (stderr, “Option -%c requires an argument.\n”, optopt); … Read more

[Solved] Is it possible to pass a char** as a parameter

Is it possible to pass a char** as a parameter Yes. The reason your code gets underlined is (probably) because this code is so ugly/unsafe that developers have added special handling in your IDE for such code to be flagged. If it is legacy code, I am sorry. If it is your code (or if … Read more