[Solved] Not getting output in case of string

You are using an uninitialized string, so assigning a to s[0] does nothing or does undefined behavior. To do this, you have to give s a size, as the options below: Option 1: Resize #include <bits/stdc++.h> using namespace std; int main() { string s; s.resize(10); s[0] = ‘a’; cout << s << endl; return 0; … Read more

[Solved] Run SQL query based on drop down value [closed]

<?php include(“dbconfig.php”); if(isset($_POST[‘submit’])) { if(isset($_POST[‘type’])) { if($_POST[‘type’] == “enquiry”) { Query } elseif($_POST[‘type’] == “enroll”) { Query } else { echo “Please select enquiry or enrollment”; } } else { echo “Please select an option”; } } ?> <form action=”dropd.php” method=”POST”> <select name=”type”> <option value=””>Please select:</option> <option value=”enquiry”>Student enquiry</option> <option value=”enroll”>Student enrollment</option> <input type=”submit” name=”submit” … Read more

[Solved] create live wallpaper using unity3d? [closed]

Go to unity store, search for uLiveWallpaper(Indie). It costs 25$. Import it to the unity app. Open uLiveWallpaper window by calling Tools → Lost Polygon → uLiveWallpaper The window consists of three tabs: “Create Project”, “Update Project”, and “About & Support”. To start creating your live wallpaper, first, you must create a Live Wallpaper project … Read more

[Solved] Two if statements?

Yes you can, but you can also use AND operator : if(true && true){} else{} //Will go in the if if(true && false){} else{} //Will go in the else If you want multiple if : if(true){ if(true){} }else{ if(true){ }else if(true){ } } Note that if you do a nested if : if(true){ if(false){} }else{ … Read more

[Solved] How to check a string for white spaces

You can know how many whitespaces user entered by doing this: Scanner sc = new Scanner(System.in); System.out.println(“Enter word with white-spaces:”); String str = sc.nextLine(); int totalSpace = str.split(” “).length-1; System.out.println(“total white-spaces is:”+totalSpace); Edit: You can solve you problem by changing your while condition like this: while(!(guessedSpaces.replaceAll(“\\d”,””).length()==3 && guessedSpaces.split(” “).length-1==3)){ ….. ….. System.out.println(“Enter word with white-spaces:”); … Read more

[Solved] Difference between get{return x} and return x [duplicate]

I assume you mean this for the second using System; public class Test { private string x; public string GetX() { return x; } } In which case it is a method that returns a string while your first example is a readonly property solved Difference between get{return x} and return x [duplicate]

[Solved] String manipulation in C (replace & insert characters)

example by use strtok, strchr, sprintf #include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ const char *data = “date=2013-12-09 time=07:31:10 d_id=device1 logid=01 user=user1 lip=1.1.1.1 mac=00:11:22:33:44:55 cip=2.2.2.2 dip=3.3.3.3 proto=AA sport=22 dport=11 in_1=eth1 out_1=”; char *work = strdup(data);//make copy for work char *output = strdup(data);//allocate for output char *assignment; //tokenize to aaa=vvv size_t o_count = 0;//output number … Read more

[Solved] How to convert Qt to C++? [closed]

I will try to help you to get started: QList is std::list QStringList is basically QList < QString > , so it is the same std::fstream can be used for QFile QIODevice is maybe std::fstream, but I am not sure Again std::fstream can be used for QTextStream 3 solved How to convert Qt to C++? … Read more