[Solved] ASP.NET: How to create a search function just using a textbox? [closed]

[ad_1] Since you didn’t provide any code here and asked for the directions, so here you go. Lets assume your TextBox name is ‘textBox1‘ and there is some button beside it. On the click event of that button you should be querying your database for the customer names that matches the text inside your ‘textBox1‘. … Read more

[Solved] I want to know about print type explicitly [closed]

[ad_1] You must a format specifier that matches the type of the value you are printing. %p expects a void *. %x expects an unsigned int. %lx expects an unsigned long. This is documented in man 3 printf. #include <inttypes.h> #include <stdint.h> #include <stdio.h> int main(void) { const char *s = “foo”; printf(“%p\n”, s); printf(“%s\n”, … Read more

[Solved] Basic C pointer syntax [closed]

[ad_1] * is both a binary and a unary operator in C and it means different things in different context. Based on the code you have provided: *leaf = (struct node*) malloc( sizeof( struct node ) ); Here the void * (void pointer) that malloc returns is being casted to a pointer to struct node, … Read more

[Solved] how to concatenate a string and an int c++

[ad_1] For C++, you need all the other important parts, such as the include files, and the namespace qualifiers. Unlike most scripting languages, the programming statements and expressions have to be in the context of a function. For example: #include <iostream> #include <string> using std::cout; using std::endl; using std::string; int main() { int Age = … Read more

[Solved] How to add OpenCV files in Visual Studio

[ad_1] Extract the OpenCV install in any directory you want. Copy the path of the directory where you extracted the OpenCV and add it to your System PATH. Restart your computer to allow it to recognize new environment variables. Open the properties of the project in Visual Studio and select VC++ Directories Select Include Directories … Read more

[Solved] Why is scanf being performed 11 times?

[ad_1] In This case space after %d is format specifier so it’s take 2 argument with space as separator. scanf(“%d %d”, &marks[i], &marks[i+1]); => 1 2 scanf(“%d “, &marks[i]); => 1 2 scanf(“%d”, &marks[i]); => 1 [ad_2] solved Why is scanf being performed 11 times?

[Solved] Frequency distribution of array [closed]

[ad_1] static void Main(string[] args) { var data = new int[11]; //spec: valid values [0-10] while (true) { Console.Write(“Enter a number [0-10] or ‘q’ to quit and draw chart: “); var input = Console.ReadLine(); var value = 0; if (inputIsValid(input, out value)) { data[value]++; } else if (input.ToLowerInvariant() == “q”) { break; } else { … Read more

[Solved] How to declare multiple variables in Turbo C++

[ad_1] Even Turbo C++ implemented this in a correct way decades ago. Function parameters need to be declared giving their types explicitly: char create_username(char forename, char surname) // ^^^^ This is needed! in contrast to declaring a bunch of local variables, where the multiple definition syntax can be used: void foo() { char forename, surname; … Read more

[Solved] adjacency matrix sum of corresponding rows and columns [closed]

[ad_1] Try this code ….i have added comment in the code to understand the logic #include<stdio.h> int main(){ int arr[20][20],i,j,n; int k,sum=0; printf(“\nEnter matrix size: “); scanf(“%d”,&n); printf(“\nEnter the matrix”); // to read the matrix for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf(“%d”,&arr[i][j]); } } //to display the matrix printf(“\nMatrix is : “); for(i=0;i<n;i++){ printf(“\n”); for(j=0;j<n;j++){ printf(” %d”,arr[i][j]); } } … Read more

[Solved] What is means of this? [closed]

[ad_1] It could mean that the interviewer wanted to test your reaction to being confronted with invalid source code. I have no idea what the intention of Func()[] = ‘a’; is. The C++ compiler clang 3.4 outputs the following: a.cc:3:9: warning: conversion from string literal to ‘char *’ is deprecated [-Wc++11-compat-deprecated-writable-strings] return “Text”; ^ a.cc:6:1: … Read more

[Solved] Error in dynamic allocation in C++ [closed]

[ad_1] You should allocate an array of chars, like so: char *CopyOf(const char *str) { char *copy = new char[strlen(str) + 1]; strcpy(copy, str); return copy; } Note that I used brackets, not parentheses. What you were doing with parentheses was initializing a single new char with the value strlen(str) + 1. Then you overran … Read more