49,761 Topics
| |
can someone give me an example that draws right triangle using asterisk using do-while loop only (without using for loop) | |
I am in the final stages of testing a text-based game I have been working on for several years but I am running into some major problems with my database access code and some very strange problems at that. What I am attempting to do is loop through a SQLite3 … | |
can someone help me, I need a program like this but it **must not use for loop**. or can someone revise it using **do loop**? I need it badly #here is the code: { int n, i, j; do{ printf("Enter a positive int n: "); scanf("%d",&n); } while (n < … | |
Hi everybody. Hope you are all well in the new year. I'm having trouble with joining two chars and displaying the output. For example Any clues as to how to do this? Thanks so much. #include <iostream> #include <string> using namespace std; int main(); { char a = 'x'; char … | |
Someone help me creating a this program. Well, I need a program that makes a triangle out of asterisk but it doesnt use "for" loop it only requires "do-while" loop. Actually I tried making one but it doesn't look like a triangle instead it jsut display a line of asterisk. … | |
void John_is_3D(int dimx,int dimy,int dimz) { int ***John; // pointer to pointer to pointer John = new int**[dimx]; // array of pointers to pointers for(int x = 0;x<dimx;x++) { John[x] = new int*[dimy]; for(int y = 0;y<dimy;dimz++) { John[x][y] = new int[dimz]; for(int z = 0;z<dimz;z++) { John[x][y][z]= x*y*z; cout … | |
write a c++ program generat a fibonacci series using while loop statement .(Hint0,1,1,2,3,5,8,13,21,34,55,...) | |
A complete C implementation of Linked List...tested on Linux GCC | |
Design and implement a class named "Vector 5D" using C++ which stores a 40 hypothetical vector having 5 components, you may assume these components as V[1], V[2], V[3], V[4] and V[5] . The class should use array to store these components. The class should have necessary constructors and member functions. … | |
hi, can you help me with my code? actually its running but the total price of products bought is not displaying, can you help me with this one? :( #include<stdio.h> #include<string.h> #include<conio.h> int main(void) { int pno, choice, product, jf=12,d=10,l=107,c=2,cf=22,n=9,b=19,ap,a,total,disc,i,ctr,nSelection; char name[50]; char cname[50]; char y; char x; float price,qty,tax,dis,bill,dprice,ttotal; … | |
write a programe to input any year and cheak whether it is leap or not | |
Write a program that allows accepting a positive integer number n and displaying n rows as the following form: Example: n =6 0 0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5 | |
chan someone help me see this problem? its closed and everything. string notename; x = 1; cout << notename[x] << endl; if(remove(notename[x].c_str()) != 0) { perror( "Error deleting file" ); } else { cout << "File successfully deleted"; } | |
I have the following code for 2D dimensional arrays being flattened as 1D C-style arrays: #include <iostream> int main() { int width = 4, height = 10; int arr[width * height]; for (int i = 0, k = 0; i < height; ++i) { for (int j = 0; j … | |
I am trying out sqlite3 create statements and forign keys in c++ and I came up with 4 requirements. 1) a employer can create a job position 2) a employer can view the form reject or shortlist the applicant for interview 3) a applicant may apply for a job position … | |
please tell me whats wrong in this code, i am getting error, help me to fix this. Course *array[10][5]; Course *array2[10][5]; while(!coursefile.eof()) { for (int i=0;i<10;i++) { for (int j=0;j<5;j++) { coursefile >> array[i][j]->getBook(); coursefile >> array2[i][j]->getSection(); } } } | |
consider this class class Course { string book; char section; public: Course (string bk, char sec) : book(bk), section (sec){} string getBook(){return book;} char getSection (){return section;} void print() { cout <<"book name is: "<<book<<endl << "section is: " << section << endl; } }; i want to make array … | |
i have 10 students, each student is associated with 5 courses and the section of course, i want to do this in array, please help regarding this. thanks. for example john book1 A book2 A book3 C book4 D book5 B marry book1 C book2 B book3 A book4 B … | |
I'm having a simple i/o with file problem. I have the name coming from a string but it just wont open at all. Incoming code: string notename[] = {"NULL","empty"}; ifstream readnote; readnote.open(notename[x].c_str(),ios::in|ios::out); if(!readnote) { cout << "Read Error"; } its prolly something small but i keep getting the error, can … | |
I have a function changeUserPassword() in user.cpp and I wanted to do a cppUnit test on it. here are some possible unit test for changeUserPassword 1. changing a password several times. 2. changing password to the same password. 3. changing a non existing password. 4. Changing the password on one … | |
can any body write QT calculator GUI application - to QT command mode program (in batch mode ) we need to give inputs from command mode | |
I have to write a program that generate 7 random numbers from 1 to 39 to write condition which don't allows to repeat the same number twice , and to sort them from the smallest to the greatest in the end to have this result **** LOTO GAME 7 TO … | |
Hello, I came across a strange pointer (in my opinion): `void *(*foo)(int *);` Why are so many stars there? It was explained like: "...read inside-out; notice that the innermost element of the expression is *foo, and that otherwise it looks like a normal function declaration. *foo should refer to a … | |
Hi Everyone, For a couple weeks, I have been developing a pi approximation program and making little upgrades. Right now, the program asks for an input of iterations and then prints out the approximation. Now, I want to have every iteration printed out into an excel file with an approximation … | |
I have the code for the first part of a problem, which is to write a program that reads an angle x (in radians) from the keyboard. Then, in a function, compute the cosine of the angle using the first five terms of this series. Print the value computed along … | |
Should I use cmath to use PI and trig functions? I dont think math.h has it - and cmath and math seem like redefine alot of the same things. What is standard practice? Thanks, Dave | |
so, im trying to make a simple funtion to see if there is a file in a folder. been looking everywhere but havent found one that worked out. annnnnnnnnnnnnd code snippet: ` WIN32_FIND_DATA FindFileData; HANDLE hFind; hFind = FindFirstFile(_T"C:\\Dev-Cpp\\notes", &FindFileData); if (hFind == INVALID_HANDLE_VALUE) { cout << "No File found\n"; … | |
hi everybody! I really need your help here. I am developing a 3D game. so far I have came no further than finishing the 3D engine and print out some basic 3D-models. everything works okay, with exception of a bug, occuring after a couple of minutes of running time. it … | |
| |
Hello, I have a quick question about c/c++ syntax. Basically I am wondering when it is allowable to have numbers in identifiers. My compiler happens to allow numbers in: * Function names * Class names * Variable names * Pre-processor names As long as they do not begin with numbers. … |
The End.