Linux supports many different methods to install MySQL. Only one of the distributions from Oracle needs to be used out of the many installations available.StepsType − Apt, set up method−Enable the MySQL Apt repositoryType − Yum, set up method−Enable the MySQL Yum repositoryType − Zypper, set up method−Enable the MySQL SLES repositoryType − RPM, set up method−Download a specific packageType − DEB, set up method−Download a specific packageType − Generic, set up method−Download a generic packageType − Source, set up method−Compile from sourceType − Docker, set up method−Use Docker Hub for MySQL Community Edition; download Docker image for MySQL Enterprise ... Read More
Some problems with compiling MySQL could be because of not configuring properly. Hence, the solution is to reconfigure.If CMake is run right after it was previously run, there is a possibility that it would use information that was gathered from its previous call. This information is present in CMakeCache.txt. When CMake begins, it looks for this file and reads the contents (if it exists), assuming that the information is correct. This assumption becomes wrong when the file is reconfigured.Each time CMake is run, ‘make’ has to be executed again to recompile. The old object files from previous builds can be ... Read More
Let’s take the concept of arrays to about compile time and run time initialization −ArrayArray is a collection of items stored at contiguous memory locations and elements can access by using indices.Compile time array initializationIn compile time initialization, user has to enter the details in the program itself.Compile time initialization is same as variable initialization. The general form of initialization of array is as follows −Syntaxtype name[size] = { list_of_values }; //integer array initialization int rollnumbers[4]={ 2, 5, 6, 7}; //float array initialization float area[5]={ 23.4, 6.8, 5.5, 7.3, 2.4 }; //character array initialization char name[9]={ 'T', 'u', 't', 'o', ... Read More
ProblemCompiler not reading the string after integer in C programming? How can we solve this problem?SolutionWhen you enter an integer number and press enter to read next value, compiler stores null into the string’s first char and string input terminates. Because scanf will terminate whenever it reads a null character.How to Solve It?When we are trying to read string or character after int or float, we should read a temporary char which is present in the input buffer.The following is the program without errors −Example Live Demo#include struct student{ char name[10]; int roll; char temp; } s; ... Read More
ProblemCommon error occurred while reading string and numeric data using scanf() function in C languageSolutionThe scanf() function is used to read formatted input from stdin in C language. It returns the whole number of characters written in it otherwise, returns a negative value.Generally in case of scanf() function while reading string values after integer from the user, we get frequent errors.ExampleFollowing is a C program which reads roll number (integer value) and name of a student − Live Demo#include struct student { char name[10]; int roll; } s; int main(){ printf("Enter information of students:"); printf("Enter roll ... Read More
ProblemTry to print a name 10 times without using any loop or goto statement in C programming language.SolutionGenerally, looping statements are used to repeat the block of code until condition is false.Example1In this program, we are trying to print a name 10 times without using loop or goto statements. Live Demo#include void printname(char* name,int count){ printf("%03d : %s",count+1,name); count+=1; if(count
Yes, we can give arguments in the main() function.Command line arguments in C are specified after the name of the program in the system’s command line, and these argument values are passed on to your program during program execution.The argc and argv are the two arguments that can pass to main function.But main() function is actually called by the operating system (or shell program) when you run the program from the terminal.SyntaxThe syntax is explained below −int main(int argc, char *argv[]){ //Code return 0; }Example Live Demo#include int main(int argc, char *argv[]){ int i; for (i = ... Read More
Implicit type conversion is done by the compiler by converting smaller data type into a larger data type.For example, ASCII value of A=65.In this program, we are giving character ‘A’ as input, now write a code to convert A to 65 which is its ASCII value.ExampleFollowing is the example to find ASCII value of uppercase character ‘A’ using implicit conversion − Live Demo#include int main(){ char character = 'A'; int number = 0, value; value = character + number; //implicit conversion printf("The ASCII value of A is: %d", value); return 0; }OutputThe ASCII value of ‘A’ ... Read More
Functions are broadly classified into two types which are as follows −predefined functionsuser defined functionsPredefined (or) library functionsThese functions are already defined in the system libraries.Programmer can reuse the existing code in the system libraries which is helpful to write error free code.User must be aware of syntax of the function.For instance, sqrt() function is available in math.h library and its usage is y= sqrt (x), where x= number must be positive.If x value is 25, i.e., y = sqrt (25) then ‘y’ = 5.In the same way, printf() is available in stdio.h library and clrscr() is available in conio.h ... Read More
Process of Creating and Running ProgramsA program contains a set of instructions which was written in a programming language.The programmer’s job is to write and test the program.The 4 steps to convert a ‘C’ program into machine language are &miuns;Writing and editing the programCompiling the programLinking the programExecuting the programWriting and editing the program‘Text editors’ are used to write programs.With the help of text editors, users can enter, change and store character data.All special text editors are often included with a compiler.After writing the program, the file is saved to disk.It is known as ‘source file’.This file is input to ... Read More