49,761 Topics
| |
I'm making a sales receipt. The user enters in the name and price of the items. On the display, I want the name of the items to be aligned as well as the price of the items. Is there a way to get the setw for the objects after the … | |
I'm creating a program using strings to create a contact card for a customer. It works to allow users to input information up until the "state" input part. It skips over this and doesn't allow a state to be entered and then continues with the remaining two inputs. On the … | |
Hi all! This is a simple piece of code that I wrote about a year ago, in response to a question on Daniweb. I decided to infuse it with some C++11 magic, which led to a pretty sweet code snippet, full of neat little techniques you might want to use, … | |
I am new to Linux, and C++. Usually when I used Java, I could just use javac Something.java and run it using java Something. How do I compile my own c++ code without the help of an IDE? Also I am using Linux Ubuntu 12.04 | |
hi i am getting a floating point error while im trying to complile the rc4 encryption in c++...i was wondering if anyone could help me out...i have the code pasted as below #include <stdio.h> #include <iostream.h> #include <ctype.h> #include <string.h> unsigned char s[256]; unsigned int i, j; void swap(unsigned char … | |
I know that it generates a public key and then a private key. You encrypt with public and can only decrypt with private key. How is this algoritm going to work in a C++ program, how am i going to compute the public key and then the private key? Also, … | |
Hi everybody! I am having some trouble running a detached process using CreateProcess function in C++. I have been using the following function to spawn processes in c++ for years now havnig no trouble. I have used it with console applications, mfc apps, dialog based ... etc : StartProc(char *callprogram, … | |
Hi, I have a Win32 Console Application which is throwing the Debug Assertion Failed! .. _CrtIsValidHeapPointer( pUserData ) and followed by a Debug Assertion Failed! .. _BLOCK_TYPE_IS_VALID(pHead->nBlockUse). After I did a Step by Step Debug strangely what I saw was it is throwing error once it is exittin the main … | |
I wanted to write a simple program that uses classes but I've been running into errors. Anyone have a clue as to what is wrong with my code because I can't seem to figure it out. #include <iostream> #include <iomanip> #include <cmath> using namespace std; class cone{ private: double radius; … | |
hey can anyone help me with the decrypt part...cant seem to get it to work.... #include <iostream> using namespace std; unsigned char s[256]; unsigned int i, j; void swap(unsigned char *s, unsigned int i, unsigned int j) { unsigned char temp = s[i]; s[i] = s[j]; s[j] = temp; } … | |
I have this code and when ever i try to put in the value 'e' it doesnt want to take it, the program freses. #include <iostream> #include <string> #include <fstream> using namespace std; int encrypt(); int decrypt(); int phi, M, n, e, d, C, N, D, answer, p, q, s; … | |
Why can't I use inline functions with my setter method in c++. Here is the code: Main.cpp #include <iostream> #include "Employee.h" using namespace std; int main() { Employee h; h.setAge(30); h.setSalary(70000); h.setyearsOfService(5); h.printAllInfo(); return 0; } Employee.h #ifndef EMPLOYEE_H #define EMPLOYEE_H class Employee { public: inline int getAge(); int setAge(int … | |
I am writing a chatbot and it's database is going to be contained in a .txt file. Now i have this code: #include <iostream> #include <string> #include <fstream> using namespace std; int main() { string line; string uinput, resp; char key = line[0]; ifstream file("t.txt"); cout<<": "; getline(cin, line); while(getline(file, … | |
#include<iostream> using namespace std; const int STACK_SIZE = 100; class stack { private: int count; // number of items in the stack int data[STACK_SIZE]; public: stack(); ~stack(); void push(const int item); // push an item on the stack int pop(void); // pop item off the stack }; stack::stack() // constructor … | |
If I write a C++ program and compile it into an executable file AND, don't have to install the program, will I have trouble running that C++ written program on other platforms? Do portability issues accross different platforms only arise when I have to install the program? I'm currently breezing … | |
I would like to use GTKmm within Codeblocks, so that everytime a new project is created, the libraries are automatically included. I think I have to tell Codeblocks under Settings/Compiler and Debugger/Search directories and then under compiler the includefiles and under linker the libs. Is that correct? | |
help i'm rather new at this but have some understanding but am having some probs with 1>c:\users\kysinden\documents\visual studio 2008\projects\real\real\test.cpp(8) : error C2144: syntax error : 'int' should be preceded by ';' 1>c:\users\kysinden\documents\visual studio 2008\projects\real\real\test.cpp(9) : error C2447: '{' : missing function header (old-style formal list?) i am makeing an number … | |
This is homework. I am trying to implement a Dictionary ADT using a hash-table with a closed addressing scheme. The problem is that I'm required to make a hash table of Word classes. How can I do this? The class has to be templated. Here is what I have so … | |
I know it's a bad practice to post the same question on more than one help site (I posted it on Stackoverflow, but after some time your question loses its place on the "active" list and people stop reading it) but I'm really desperate here. So my question is: I … | |
calculate and display the square root of each value in NumArray then store it in an array called SquareNumArray. hi guys what is wrong with this code? #include <stdio.h> int main() { int numArrays[] = {2, 67, 23, 5, 7, 34, 14, 4, 8, 62}; int SqareNumArray[]; int i; for(i=0; … | |
calculate and display the average of all even values . #include<stdio.h> int main() { int numArrays[] = {2, 67, 23, 5, 7, 34, 14, 4, 8, 62}; int i, sum=0, ave=0; for(i=1; i<10; i++) { if(numArray[i]%2==0) printf("%d", numArray[a]); total+=numArray[a]; sum=sum+total; printf("the total of all even number is; %d", sum); } … | |
calculate and display the average of all even values . #include<stdio.h> int main() { int numArrays[] = {2, 67, 23, 5, 7, 34, 14, 4, 8, 62}; int i, sum=0, double ave=0; for(i=1; i<10; i++) { if(numArray[i]%2==0) { printf("%d", numArray[a]); total+=numArray[a]; } { sum=sum+total; printf("the total of all even number … | |
im not god in programing im stil new to it need help please find the MAX and MIN number then calculate and display the average [(MAX+MIN)/2] #include<stdio.h> int main(void) int NumArray[] = {2 ,67 ,23 ,5 ,7 ,34 ,14 ,4 ,8 , 62}; int max, min, i; double b; max=numArray[i] … | |
help please ^^ create another array, call it ArrayNum, then store the value of NumArray in reverse order. display the value in ArrayNum. #include <stdio.h> int main(void) { int numArrays[] = {2, 67, 23, 5, 7, 34, 14, 4, 8, 62}; int ArrayNum[10]; int a; for(a=o; a<10; a++) { ArrayNum[a]=numArray[9]; … | |
I'm working on a problem to balance a checkbook. I've been struggling with it so I split it up into its components. I first made an array to store withdrawals. When I ran this program, everything ran fine. Now I'm trying to create a second array to store deposits. I … | |
I started this code, and it does encode the text, however it only does the first line of text and repeats it. It is also encoding spaces. #include <fstream> #include <iostream> #include <string> using namespace std; int main() { ifstream fin; string fileName; cout << "What file do you want … | |
int NumArray[]="2 ,67 ,23 ,5 ,7 ,34 ,14 ,4 ,8 , 62"; A. display all the value of NumArray with an ODD index B. display all the value in NumArray that are ODD C. calculate and display the average of all EVEN values D. create another array, call it ArrayNum, … | |
#include <stdio.h> int main() { int numArrays[] = {2, 67, 23, 5, 7, 34, 14, 4, 8, 62}; int i; printf("Odd Numbers in numArray:\n"); for(i=0;i<10; i++) { if(numArray[i]%2==1) { printf("%d ",numArray[i]); total += i; sum=sum+total; sum=sum+1; printf("There are %d odd numbers\n", sum); } } printf("even numbers in numArray;\n"); for(i=0; i<10; … | |
help i'm rather new at this but have some understanding but am having some probs with 1>c:\users\kysinden\documents\visual studio 2008\projects\real\real\test.cpp(19) : error C2660: 'atotal' : function does not take 1 arguments 1>c:\users\kysinden\documents\visual studio 2008\projects\real\real\test.cpp(21) : error C2061: syntax error : identifier 'a' 1>c:\users\kysinden\documents\visual studio 2008\projects\real\real\test.cpp(23) : error C2660: 'atotal' : function … | |
#include <iostream> using namespace std; int answer(int x,int y); //function proto int mutab[10][12]; //two dimentional array declaration int main() { for (int i=0;i<1;i++) //this will fill 1-10 of the multiplication table { for (int h=0;h<10;h++) { mutab[h][i]=h+1; } } for (int i=0;i<10;i++) //this will fill 1x1,1x2,1x3 etc.. to ......10x11,10x12 { … |
The End.