[Solved] CodeBlocks C++ program not running

It looks like you have something wrong in your compiler settings. Maybe look at this question: CodeBlocks : [highlight: No such directory found All I did was go to “Compiler Settings” (“Settings” -> “Compiler” -> Global compiler settings), and selected “Reset Defaults”. Does that work for you? 1 solved CodeBlocks C++ program not running

[Solved] IF statement doesn’t go through [closed]

with the values 3 5 3 1 the test if(xp1!=xp2 && yp1!=yp2){ is false because xp1 and xp2 value 5, so you do nothing And as I said in a remark if(x1<=1000000 && x1>0 && x2<=1000000 && x2>0 && y1<=1000000 && y1>0 && y1<=1000000 && y1>0){ must be if(x1<=1000000 && x1>0 && x2<=1000000 && x2>0 … Read more

[Solved] array inside function

#include<stdio.h> #define MAX_SIZE_ALLOTED_TO_EACH_QUESTION 100 #define NUMBER_OF_QUESTIONS 10 int scoreList[NUMBER_OF_QUESTIONS]; // This array will contain the individual score for each answers to respective questions int i; void Extroversion(int scoreList[]){ // Let formula for this be E = 20 +(1)___-(3)___+(2)___-(4)___ int E = 20 + (scoreList[1] + scoreList[2]) – (scoreList[3] + scoreList[4]); printf(“\nExtroversion is the personality trait … Read more

[Solved] What is the cause of “It seems that this project has not been built yet. Do you want to build it now?” message when compiling using Codeblocks? [closed]

What is the cause of “It seems that this project has not been built yet. Do you want to build it now?” message when compiling using Codeblocks? [closed] solved What is the cause of “It seems that this project has not been built yet. Do you want to build it now?” message when compiling using … Read more

[Solved] Sum of 10 number until 0 is keyed in [C++]

i wrote something, you can compile it online http://cpp.sh/6u447 #include <iostream> int main() { int arr[10] = { 0 }; for(int i=0;i<10;i++){ int temp ; std::cin>>temp; if(temp == 0){ break; } arr[i] = temp; } int sum =0; for(int j=0;j<10;j++){ sum+=arr[j]; } std::cout<<“sum is “<<sum; } 5 solved Sum of 10 number until 0 is … Read more

[Solved] Ancient Japanese calendar exercise in C++

According to your list the Color rotates in a 10 years cycle and then has always 2 subsequent years with same color. Given that rule you can calculate an index in a field of year colors. #include <vector> #include <string> #include <iostream> using namespace std; int main() { const int base_year = 1984; vector<string> colors … Read more

[Solved] How can I cancel an inputting when a previously defined time is over

It practically is operating system specific, since the C++11 (or C++14 or C++17) standard don’t offer any such facilities (the only standardized way of getting input being C++ streams such as std::istream or C stdio files à la FILE*). You probably need some external libraries. On Linux or POSIX systems, consider (for a terminal interface) … Read more

[Solved] Program stopped working, when tried to run

You have your main problem here. double *tabT1; double *tabT2; tabT1[0]=1; tabT1[1]=tabX[j]*(-1); tabT2[0]=1; tabT2[1]=tabX[i]*(-1); You haven’t allocated the memory, instead, you have just declared the double ptrs tabT1 and tabT2 and accessing them by pretending you have allocated. double *tabT1 = new double[2]; double *tabT2 = new double[2]; will fix this, however, I strongly suggest … Read more

[Solved] wrong result in Visual Studio

insert_recursively does not return a value when it goes into else block however you store the returned value (garbage) in right_linker or left_linker anyway. Note that compiler issues a corresponding warning: warning C4715: ‘insert_recursively’: not all control paths return a value 1 solved wrong result in Visual Studio

[Solved] Error in code, programming in C

You need to allocate an array of vectors, using malloc. typedef struct { float x; float y; }vectors; vectors initializeVector(vectors userVect[], int length); int main() { /* This block determines the amount of vectors that will be added. It will then create an array of vector structs the size of the amount being added. Afterwards … Read more