[Solved] How to adress variable by name stored in another variable (C++)

Variable names disappear as part of the compilation step(s) in C and C++. Typically, there are two scenarios that solve the type of problem you are describing: User input corresponds to specific variable name. You don’t actually want the “name” of the variable, but just need a way to associate different data with different parts … Read more

[Solved] CodeIgniter Upload from User Class

Its hard to know what you mean without seeing any code but its sounds like you are not loading the upload library. You should be able to use any of the upload function after you have loaded it $this->load->library(‘upload’); 1 solved CodeIgniter Upload from User Class

[Solved] Fatal error: Call to a member function prepare() on a non-object in C:\wamp\www\sideProjects\loginTut\db.php on line 20 [closed]

You forgot to assign a value to $conn from the return value of DBConnect(), eg this DBconnect($config); should be $conn = DBConnect($config); You also don’t need to use global $conn in your script as it will be in scope. I’d also recommend not catching the exception from the PDO constructor. How else will you know … Read more

[Solved] Vector Subscript Out of Range C++ [closed]

The problem is that in the DeckOfCards class, the deck vector is never added to, so it’s empty. In the constructor, assign newDeck to deck: deck = newDeck; There is also another problem in the constructor: You declare newDeck to contain 52 entries, but then you use push_back to add new entries to the vector. … Read more

[Solved] AutoScrolling with zooming image in iphone

– (void)viewDidLoad { [super viewDidLoad]; // 1 UIImage *image = [UIImage imageNamed:@”photo1.png”]; self.imageView = [[UIImageView alloc] initWithImage:image]; self.imageView.frame = (CGRect){.origin=CGPointMake(0.0f, 0.0f), .size=image.size}; [self.scrollView addSubview:self.imageView]; // 2 self.scrollView.contentSize = image.size; } viewDidLoad First, you need to create an image view with the photo1.png image you added to your project and you set the image view frame … Read more

[Solved] remove text from multiple spans having same id [duplicate]

Dont give same ID to more than one one tag, use class instead <span class =”myId”>data1</span> <span class =”myId”>data2</span> <span class =”myId”>data3</span> <span class =”myId”>data4</span> <span class =”myId”>data5</span> call this function to clear function clearAll() { var ele= document.getElementsByClassName(“myId”); for(var i=0;i<ele.length;i++) { ele[i].innerHTML=”; } } 2 solved remove text from multiple spans having same id … Read more

[Solved] C programming code error

These: scanf(“%i”, y[i][j]); scanf(“%i”, d[i]); needs to be: scanf(“%i”, &y[i][j]); scanf(“%i”, &d[i]); as %i in the scanf expects an int*(address of the variable), not an int(value of the variable). Another problem is that you do division by zero here: inv[i][j] = co[i][j] / D; when D is zero. solved C programming code error

[Solved] How to save results from the game to text file [closed]

I’ve created a basic class for you that will save the wins to a text file and retrieve them from a text file. import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Scanner; public class WinsFileManager { String path = System.getProperty(“user.home”).replace(“\\”, “\\\\”) + “\\”; public int getWins(String fileName) { String fullPath = path + fileName; int wins … Read more

[Solved] How to grey out part of a form? [closed]

Thanks for improving your question. One approach you could take is to add a class to each professor option which indicates which majorID it’s associated with like this: <div class=”form-div”> <h3><label for=”prof”> Then Select Professor: </label> <br></h3> <select class=”form-input” id=”prof” name=”prof”> <?php foreach ($professors as $prof) { ?> <option class=”major-<?php echo $prof[‘majorID’]; ?>” value=”<?php echo … Read more