49,761 Topics
| |
here's my code: #include <iostream> #include <iomanip> using namespace std; int main() { char name[30], choice; int hours_worked; float wage; do { cout << "Employee Name: "; cin.getline(name,30); cout << "No of hours worked: "; cin>>hours_worked; cout << endl; wage = 80.75*hours_worked; cout << "The salary of " << name … | |
> I know that the max value for short data type is 32767 and d=2*a=2*(20000)=40000 that is greater than 32767 > therefore the result of d is in minus d= -25536 while a,b and c displayed as they are scince they are< 32767 ,but the question is from where we … | |
Hello , I have this: #include <iostream> #include <cstdio> #include <cstdlib> #include <vector> using namespace std; typedef struct { float x; float y; Point *next; } Point; int main() { Point *thePoints = new Point[2]; thePoints[0].x = 2; thePoints[0].y = 3; thePoints[1].x = 4; thePoints[1].y = 5; (thePoints[0])->next= 11; cout … | |
Hi All, I below code snippet I have been using diff-2 structure with same variable due to having different -2 default values for the variable (var) in current implementation for both the structure a and b. This way i need to create 17 structure with same variable (var) but different … | |
Write a program that prompts the user for a value for i and displays the e value, and this is all i have so far. I was told it's suppose to have two for loops but i'm not sure where and how to do it and i know my output … | |
does anyone know how to do the program that are more or less like peteranswers?? This is the website which has been using to trick people... [URL="http://www.peteranswers.com/"]http://www.peteranswers.com/[/URL] and this is the secret : [URL="http://chriswondra.com/2007/02/21/peter-answers-the-secret/"]http://chriswondra.com/2007/02/21/peter-answers-the-secret/[/URL] i'm just wondering if i'm capable to do just a simple program that is similar like … | |
i know save the Image on IStream. but what isn't saved like the original: the backcolor goes to black instead stays white. i belive that the problem is the transparent color, because isn't saved on IStream. i had tryied use the ColorPalette(Image.GetPalette() and Image.SetPalette(), but the ColorPalette.Count it's zero), but … | |
I have a notepad that consist of two data which is the title and the name. I've declared the title using an enum. The enum contain this variables. enum Title {Miss, Mrs, Mr, Dr, Unknown}; Then in my structure, I attempted to call the variables from the enum like this … | |
Ikd what the error is telling me as when it compiles, no red lines appear. Plz help me >_< ! thanx in advance #include "stdafx.h" #include <iostream> #include <stdlib.h> using namespace std; #include "Shapes.h" #include "ShapeFeatures.h" int main() cout << "\n\n\n"; return 0; } //Shapes.h #pragma once class Shapes { … | |
I'm guessing the error lies in the writeBinary function where I open the file everytime I write into it. I am not sure how to create the file and have it not overwrite the existing data. My code results into reading 3, 3, 3 instead of 1,2,3. #include <string> #include … | |
I wrote a function that is supposed to crop a 2d vector starting at point r, c. The rectangle from there should have rows rows and cols columns. void pgm_crop( vector <IVec> p, int r, int c, int rows, int cols ) { int count = 0; //first count variable … | |
i down loaded 24 c++ programs from the MIT ( Massachusets institute of technology) web site. when i compiled the programs all the programs are giving the same warning messages " functions containing for, while, switch are not expanded inline". if i remove the word inline from the programs will … | |
Can anyone tell me how to calculate yesterday's date using c++? | |
Hello My Turbo C/C++ 4.0 was working properly in my Windows 7 64-bit but from two days i am not be able to use keyboard in Turbo C. I can't type any text. But mouse is working. Tried with DOS BOX Turbo C3, reinstalled it many times but could not … | |
Hi guys. Well according to the research I had, and MP3 file structure is as follows: ` AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM ` which is refered to as frames, and each. Each letter is one bit. I've seen samples demonstrating how to get data from this but what I want is … | |
If I made a program, and I wanted a random number. I know it's not compleatly possible, since it takes numbers out of the ram. Although there must be worse and better ways to do this. What are the better ways do do it. | |
| |
Hello guys, I found this C# article in daniweb forum and now I want rewrite the class described on the below link in C++ using WinSock64 lib but I'm newer in C++ programming and would like to have any idea to initiate the task. follows the link: https://www.daniweb.com/programming/software-development/code/422291/user-friendly-asynchronous-event-driven-tcp-client Best regards. | |
I'm having a lot of issues wring codes in C++ specialy when 3 files are required (.h, .cpp and main.cpp). Very different to C that it was very easy for me but not now with C++. I nee to write a program to do the following: Create 3 files for … | |
#include<iostream.h> #include<conio.h> class twonum { private : int x,y; public: void getvalues() { cout<<"enter any two numbers"; cin>>x>>y; } void putvalues() { cout<<"\n\n"<<x<<","<<y; } int add(int x,int y) { return(x+y); } int multiply(int x,int y) { return(x*y); } void swap(int x,int y) { int c; c=x; x=y; y=c; cout<<x<<","<<y; }; … | |
I want to generate a list of passwords of a cretain length passwords from a packet FILE. The packet file means a .txt FILE which contains more than 1M passwords of certain lengths. I want to store password of DIFFERENT length in a various .txt FILES /*this code is used … | |
Dev-C++ v 4.9.9.2 IDE When I compile and run my program as a console project, a window flashes very briefly on the screen and disappears. The compile log says compilation was successful and execution terminated. How to I keep the window (my output window?) from disappearing? | |
Why wont the if look for both Peter and John? #include <iostream> #include <string> using namespace std; int main() { string Name, Mood; // obvious string cout << "Whats your name?" << endl; cin >> Name; if (Name == "Peter"|| "John") { cout << "Hello, master! How are we feeling … | |
im using http://cpp.sh/ as my ide. but clrscr() and gotoxy() is not working since conio is not recognize...is there any header file that supports this codes? please help..thanks #include <iostream> #include<conio> using namespace std; int main() { clrscr(); gotoxy(5,10);cout<<"HELLO WORLD"; } | |
I'm trying to write a basic program for a C++ lab for class, and running into some trouble. Senario is that the program averages grades. A user enters the number of grades, then enteres a letter grade, then the program runs for however many grades the user has, then averages … | |
int* poly = new int[lines.size()]; for(int i=0;i<lines.size();i++)poly[i] = - 1; int curPoly = 0; vector<vector<cv::Point2f> > corners; for (int i = 0; i < lines.size(); i++) { for (int j = i+1; j < lines.size(); j++) { cv::Point2f pt = computeIntersect(lines[i], lines[j]); if (pt.x >= 0 && pt.y >= 0&&pt.x<img2.size().width&&pt.y<img2.size().height){ … | |
I need save each word of text file into array of strings I have this code how to do for convert into dinamically #include <stdio.h> #include <conio.h> #define MAX_CHARS 20 typedef char string[MAX_CHARS+1]; // leave one space for '\0' main(){ int i; string array[4]; FILE *data; data = fopen("ard.txt","r"); for(i … | |
Hi i am new to cpp i have created a win32 project in visual studio but i need to read a xml file with ms xml the xml file <game> <id="g"> <name>gta</name> <ver>1</ver> </id> <id="x"> <name>mta</name> <ver>5</ver> </id> </game> please answer | |
Hello, I've been in the process of teaching myself C++, going through different tutorials and like. Anyway I was working on a fibonacci sequence program - I looked through the practice problems here and decided to do them all from beginner on upward. I thought I had it working only … | |
How should I concatenate the characters read from a file with fgetc to determine if it is a number, keyword or an identifier? The problem is that, for example, the number 555 must be one and 5 and 5 and 5 as words must be jose and not character by … |
The End.