[Solved] I can not input the names into the char array using scanf

By char *stdnames[100]; you got an array of (pointers to char). The NEXT BIG QUESTION is Who will allocate memory for each of these pointers? A small answer would be – You have to do it yourself like below : stdnames[count]=malloc(100*sizeof(char)); // You may replace 100 with desired size or stdnames[count]=malloc(100); // sizeof(char) is almost … Read more

[Solved] Python Iterate Over String

Something like this? string = “AABBCCCASSDSFGDFGHDGHRTFBFIDHFDUFGHSIFUGEGFGNODN” for n in range(len(string)-15): print(string[n:n+16]) You have to iterate over every character up to the last character that has 16 characters after it (so the length of the string, minus 15 (because indexing starts at 0) : len(string)-15), and then print the string sliced at that starting index up … Read more

[Solved] What is wrong with my class code [Python]?

You need to pass argument to your constructor. s1 = Square(1) # will call Square.__init__(self, 1) s2 = Square(2) # will call Square.__init__(self, 2) It’s not a big problem. Update I rewrite your class: import math class Square(): def __init__(self, length): #return an instance of this class with ‘length’ as the default length. self.length = … Read more

[Solved] How to get search result by a keyword from different table in MySQL for php? [closed]

Maybe something like this? SELECT p.title, p.model_no, b.brand_name, c.category_title, s.specification_title FROM tbl_product AS p LEFT JOIN tbl_brand AS b ON b.id = p.brand_id LEFT JOIN tbl_category AS c ON c.id = p.category_id LEFT JOIN tbl_product_specification AS s ON s.product_id = p.id WHERE p.title LIKE ‘keyword’ OR p.model_no LIKE ‘keyword’ OR b.brand_name LIKE ‘keyword’ OR c.category_title … Read more

[Solved] Custom thumbnail grid 3 columns? [closed]

like this? or you want the image fill the div?: <div class=”col-md-4 no-pad”> <img class=”img-responsive” src=”https://placehold.it/1280×640/eee”> </div> <div class=”col-md-4 no-pad”> <img class=”img-responsive” src=”https://placehold.it/1280×640/eee”> </div> <div class=”col-md-4 no-pad”> <img class=”img-responsive” src=”https://placehold.it/1280×640/eee”> </div> .no-pad{ padding-left:0px; padding-right:0px; height:381px; } .no-pad img{ width:100%; height:100%; } 3 solved Custom thumbnail grid 3 columns? [closed]

[Solved] confusing notation in C++ (OMNeT++)

Let us assume that msg->dup() returned void * — that is, a pointer to void, which means a pointer whose type the compiler doesn’t track. But you may know, e.g. because of documentation on that function, or because certain preconditions have been met, that msg->dup() will return a pointer to CMessage. Before you can use … Read more

[Solved] How do I restrict special characters except underscore, hyphen and dot in email field in PHP? [duplicate]

Use a RegEx like this: /^[\w\.]+@/ Then you should also check if the domain really exists. PHP: $regex = “/^[\w\.]+@/”; $email = emailField($_POST[’email’]); $domain = preg_replace($regex, ”, $email); //get the domain of the email address by removing the local-part //Using checkdnsrr we are checking if this domain is registred if($email == ” && preg_match($regex, $email) … Read more

[Solved] putting float numbers in lists [closed]

Just create lists: somelist = [p1, p2] You probably want to append those to another data structure initialized outside of your loop: somelargerlist = [] for presumed_loop_variable in presumed_loop_not_shown: p1 = … p2 = … somelist = [p1, p2] somelargerlist.append(somelist) 17 solved putting float numbers in lists [closed]