49,761 Topics

Member Avatar for
Member Avatar for Marcial

I wrote the code below and it runs well. However, how do I make it so that 'Jeanne' enters her own name instead of the numeral 01 to get the message 'Welcome Jeanne'? Thank you. // This program assigns a code to 'Jeanne' (analogous to a pass code) [CODE] Actual …

Member Avatar for Marcial
0
204
Member Avatar for HASHMI007

[CODE] #include<iostream.h> #include<stdlib.h> struct rectInfo { int hight; int width; int area; int parimeter; void print() { cout<<hight<<" "<<width<<" "<<area<<" "<<parimeter<<endl; } }; void calArea(rectInfo *p,int n){ for(int i=0;i<n;i++){ p[i].area=p[i].hight*p[i].width; p[i].parimeter=2*(p[i].hight +p[i].width); } } void genData(rectInfo *p,int n) {for(int i=0;i<n;i++){ int a=rand()%10; int b=rand()%10; p[i].hight=a; p[i].width=b; } } int main() …

Member Avatar for HASHMI007
-6
91
Member Avatar for d1e9v85

for a assignment i need to create an array dynamically so then late i have to sort the array but the problem is i an new in this cousrse and i dontknow how to creat an array dynamically please help any help will be a good start for me \thx

Member Avatar for NathanOliver
0
157
Member Avatar for student786

Hi there. I wonder if anyone can help me. I have this code but it only works for a 3 by 3 matrix. I was wondering if anyone could help me change it to a for loop so you can work out different matrixes like a 4 by 30 matrix. …

Member Avatar for daviddoria
0
163
Member Avatar for SourabhT

[CODE] #include "stdafx.h" #include<iostream> using namespace std; template<class stype> class Stack { private: struct node { stype data; node * next; }*q; public: Stack() { q=NULL; } void push(stype d) { struct node * temp; temp=q; temp=new node; temp->data=d; if(q==NULL) { temp->next=NULL; q=temp; } else { temp->next=q; q=temp; } } …

Member Avatar for mike_2000_17
0
160
Member Avatar for AODfan

The assignment my instructor has assigned as for to read an input file and count all 3, 4, 5, and 6 letter words and out put those to an output file. From what data I had been provided by my instructor, I think he wants us to use char data …

Member Avatar for Ancient Dragon
0
114
Member Avatar for stereomatching

my os : windows xp sp3 compilers : gcc 4.5(minGW) IDE : code blocks 10.05 As the title, when I didn't enable the command [b]-std=c++0x[/b] CImg can work with gcc4.5 and code block(after Build Options > Linker Settings > Link libraries > Add and enter gdi32) Or use this kind …

Member Avatar for stereomatching
0
226
Member Avatar for mrnobody

hi, i'm did a program in C++6.0 that retrives data from Access. the program was ok and runs normally for quite sometime and suddenly the error [B]"Unable to Create File Buffer"[/B] appear. After searching high and low for solution and trying multiple suggestions, i found that that problem is because …

Member Avatar for vijayan121
0
328
Member Avatar for fadi_1234
Member Avatar for fadi_1234
0
142
Member Avatar for RyanMcMillan

How Would i be able to check for valid input on cin or getline heres what i have [CODE] #include <iostream> #include <string.h> using namespace std; int main() { string word; getline(cin, word); cout << word; system("PAUSE"); return EXIT_SUCCESS; } [/CODE] what i mean by valid input is either if …

Member Avatar for Fbody
0
538
Member Avatar for plang007

How do I change it so that it will only say how many times the program has ran once I typed another key then [B]y[/B]. Output: ================================= Programmer Name: Peter Langlands Program 3 Description: CS 150 Spring 2011 Lab CRN: Date: ================================= Enter an nonnegative number: 10 a0 = 10 …

Member Avatar for plang007
0
321
Member Avatar for plang007

How would I make this program that it tells me the number of odds or evens. I only have 1 number at the time, so I need it to either say 1 odd or 1 even. [CODE]#include <iostream> #include <fstream> using namespace std; void printInfo(); int nonNegative(int a, int k); …

Member Avatar for plang007
0
1K
Member Avatar for aloth

I'm new to C/C++ and I'm having difficulty with calculating leap years in my Zeller's Algorithm program (based off of the Gregorian Calendar). I've lost sleep over this code for the last week and this is my final breaking point. I continually get "This day is Friday." for input 1 …

Member Avatar for mike_2000_17
0
809
Member Avatar for D2008

i have a empty c++ win32 console program Peter.cpp and a window form John.h added. a error of " error C2061: syntax error : identifier 'John' " just comes out due to the code " Application::Run(new John); " when complie. could you please help me to fix the program? thank …

Member Avatar for pseudorandom21
0
186
Member Avatar for TailsTheFox

Hello, I am looking to simulate keyboard inpout for a computer in general, not just for a window. I was allready told how to simulate keyboard strokes in a certan window, although I just want to simulate them as they might be in general. As in program says "X" and …

Member Avatar for pseudorandom21
0
206
Member Avatar for rbduck09

I NEED HELP!! I'm writing a program where the user inputs the pH Level and it goes and tells if it is a certain solution. Some of them work some don't Can somebody tell me where in my code I am going wrong. I am not asking for the solution …

Member Avatar for Ancient Dragon
0
152
Member Avatar for quintoncoert

can anyone tell me if it is possible to connect to a database (for example an access database) from visual c ++ 6.0? And if one can how does one do it? Is it some wholy complicated thing or is it as easy as doing it in visual basic 6.0 …

Member Avatar for Ancient Dragon
0
761
Member Avatar for g_u_e_s_t

How can I go about concatenating two arrays of char(ex. char boy[] and char girl[]) so that the contents of girl is attached to the contents of boy?

Member Avatar for Ancient Dragon
0
127
Member Avatar for JesseFarmer

I have searched but i can not seem to find an answer to my problem. I have to write a program that lets the user enter their salary, and calculates their salary with a 5% raise for 3 years. When I run the program and enter the value for cSalary …

Member Avatar for Ancient Dragon
0
128
Member Avatar for imhiya

[CODE] #include <iostream> #include <cstdlib> #include <cstdio> #include <fstream> #include <string> #include <vector> #include <sstream> #include <list> #include <limits.h> using namespace std; class Node { public: string name; vector<string> edges; vector<int> dist; }; class Path { public: vector <int> distance; vector <string> fromwhere; vector <int> complete; vector <string> cities; vector …

Member Avatar for rubberman
0
137
Member Avatar for highflyer8

Hi, I am getting an error message when using base classes. The error message is x: undeclared identifier y: undeclared identifier z: undeclared identifier The particle class derives from the fourvector class which derives from the threevector class, as follows. [CODE]#ifndef THREEVECTOR_H // Prevents the class being re-defined #define THREEVECTOR_H …

Member Avatar for mrnutty
0
157
Member Avatar for Craftknight

Alright, I have some questions. 1. This code does make some sense right? 2. I keep getting my failure to open file message, did I make the program do that or are my test files just not working? 3. How do I make the program acknowledge - and + as …

Member Avatar for Craftknight
0
150
Member Avatar for salty11

In this program everything work except the change back, the quarters, dimes, nickels, and pennies wont work, everytihng else works, for my input i used 65.67, which with hst came out to 75.52, the amount tendered was 100. I just need help with getting the quarters, dimes, nickels, and pennies …

Member Avatar for salty11
0
162
Member Avatar for Akill10

Hey, I am having trouble trying to set a default value for a function in one of my classes. Here is where I am trying to set it: [CODE] void Sprite::Spr_Blit(SDL_Surface* source, SDL_Surface* dest, SDL_Rect* clip = NULL) { SDL_Rect offset; offset.x = getX(); offset.y =getY(); SDL_BlitSurface(source,clip,dest,&offset); } [/CODE] Here …

Member Avatar for RyanMcMillan
0
151
Member Avatar for kyxler

I need help to make this program be output *******E * ** *** **O****> *** ** * *******E Thanks for helping

Member Avatar for RyanMcMillan
0
84
Member Avatar for TailsTheFox

Hello, I've been searching the internet and i haven't been able to find anything on my problem. Anyways, I'm trying to read cursor positioning on my screen, and send it to a variable. Just to make things easier, what would I type in the code region for a button; [CODE]private: …

Member Avatar for TailsTheFox
0
162
Member Avatar for taumang

x =5 while(x<7) print the value of x x=x+1 while(x>2) print the value of x x=x-2 so i was thinking that the output of the program will be 5677753 but my program is against my opinion so i want to know the right output #include <iostream> using std::endl; using std::cin; …

Member Avatar for taumang
0
302
Member Avatar for taumang

hi,please help me with this program ,iwant it to print values of x not x #include <iostream> using namespace std; int main() { int x = 5; while(x < 7) { std::cout<<" value of x"<<'\n'; x=x+1; } while(x > 7) { std::cout<<" value of x"<<'\n'; x=x-2; } return 0; }

Member Avatar for Ezzaral
0
102
Member Avatar for daviddoria

If I have this structure: [code] class Parent { public: virtual void MyFunction() {// do something} }; class Child { public: virtual void MyFunction() {// do something else} }; [/code] The Parent::MyFunction() seems to always be called, even with: [code] Child MyChild; MyChild.MyFunction(); [/code] Is this expected? David

Member Avatar for mike_2000_17
0
149
Member Avatar for blee93

This is my failed attempt at creating the Sieve of Eratosthenes. Can anyone spot any problems? I just started to learn the STL, but the concept of iterators and the STL in general is really difficult for me. -The input represents the number of cases. The variable m represents the …

Member Avatar for Narue
0
135

The End.