49,757 Topics

Member Avatar for
Member Avatar for dustin.short.5

So I am taking C++ at thomas edison state college for a degree. I needed a computer course so I chose C++ instead of PLCs. The reason being is that I used to do some basic coding back in the apple IIe days. I apparently don't have the attention span …

Member Avatar for WaltP
0
326
Member Avatar for crissium

this game is called "pig latin" it spit all the string, put the first consonant to the end and adds "AY" to the end. for example --> "this is test" --->"histAY isAY estAY". it gives me string subscript out of range. thanks #include <iostream> #include "conio.h" #include <string> #include <sstream> …

Member Avatar for crissium
0
157
Member Avatar for wids101

#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { int soda; cout << "Choose a drink or 6 to quit:"; << endl; cout << "1. Coke $1.00"; << endl; cout << "2. Water Free"; << endl; cout << "3. Sprite $1.25"; << endl; cout << "4. Dr. …

Member Avatar for wids101
0
390
Member Avatar for valenluis
Member Avatar for L7Sqr
0
35
Member Avatar for Dwayne2long

I'm writing a program that unable me to extract timing(time that i used to finish typing my password). When running my program, i need to shutdown/close all the background processes to prevent any delay whn i extract the time. Any coding(C++ or C#) can help me to shutdown/close all the …

Member Avatar for rubberman
0
128
Member Avatar for jdh1231

Hi, I am trying to put random numbers in array, and use the array for other functions. However, I am stuck on inputting and displaying that array with random numbers. Can someone help? Please ignore other cases, and focus on case 0, which is displaying the elements of the array. …

Member Avatar for np complete
0
317
Member Avatar for Kamina00

Hi I am new to C++ and I just need some advice on declaring dynamic arrays. Take for example this code block: int a=0; cout << "Enter Arr size: "; cin >> a; int arr[a]; My compiler gives no error doing this but looking around the web I see many …

Member Avatar for Kamina00
0
219
Member Avatar for quantumss

I'm causing input letters to write ones into variables through an array. I'm trying to count the occurences of ones in a variable. Lets say I input aaaaa. The count output displays 12345. Instead of outputting the whole count of numbers, I want to output the biggest number in the …

Member Avatar for np complete
0
218
Member Avatar for np complete

This is a factorial program which uses array to calculate large factorials. The problem is sometimes if I enter 1000, it gives the output but stops working there after. I tried it with 2000, 3000, it works fine. I cant understand its erratic behaviour? Is there any problem with my …

Member Avatar for np complete
1
120
Member Avatar for Brian_L

#include <iostream> using namespace std; class Lists{ public: void insert_head(int insert); void remove_head(); void insert_tail(int insert); void print(); Lists(); private: Node *head; Node *tail; }; struct Node{ int data; Node *link; }; int main() { Lists temp; temp.print(); return 0; system("PAUSE"); } Lists::Lists(){ head = new Node; head->Link=tail; tail->Link=NULL; } …

Member Avatar for JasonHippy
0
147
Member Avatar for hillman.chen

Hi guys, I am trying to write a program that will ask for users name, birthdate and pet and from those info I need to use a random number generator to select 6 char from the name and animal and 2 numbers from the birthdate. This is my code to …

Member Avatar for vijayan121
0
416
Member Avatar for subith86

I have a code which gives the maximum value I can get by filling the knapsack with the optimal set of weights. int arr[5] = {0, 0, 0, 0, 0}; int Weight[5] = {2, 5, 8, 7, 9}; int Value[5] = {4, 5, 7, 9, 8}; const int n = …

Member Avatar for Lucaci Andrew
0
272
Member Avatar for riahc3

Hello How do I write a C++ program targeting a x86 version of Windows CE in Visual Studio 2008? It doesnt show me Windows CE and more so, all it targets is ARM. Thanks

0
65
Member Avatar for linabeb

hi all i would like to ask...ermm i have an erorr it say that my winscard.h no such file or directory...when i search it in my include folders there is no winscard.h in that folders..so...what should i do..is it somekind relate to the pcsclite.h ??? do i need to install …

Member Avatar for rubberman
0
2K
Member Avatar for juliani91

A corporation has six divisions, each responsible for sales to different geographic locations. Design a DivSales class that keeps sales data for a division, with the following members: • An array with four elements for holding four quarters of sales figures for the division • A private static variable for …

Member Avatar for rubberman
0
502
Member Avatar for TheNotoriousWMB

I am building an application that calculates travel time necessary to reach a user selected destination from predetermined city based upon an estimated travel speed determined by the user. For this program I am to utilize classes/class source files. When compiling my source file I continuously get the error “undefined …

Member Avatar for TheNotoriousWMB
0
293
Member Avatar for hello10
Member Avatar for Some Dude

So basically I am new to API programming and teaching myself. I've done a bit of console C++ that I got off of.... an internet tutorial. The story is the same here too. I am somewhat aware of what the lines of code do, though I am not yet a …

Member Avatar for neithan
0
310
Member Avatar for Darth Vader

Hi, The below TimeZone code returns the following string: "(GMT-05:00) Eastern Time (US & Canada)" TimeZoneInfo FromZoneID = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); What I wonder how it is possible to do is how I create the TimzeZoneInfo object by using the string directly. I have tried this but it doesn´t work. …

Member Avatar for BobS0327
0
142
Member Avatar for noblepants

Hi every I'm new here and new to programming. : ) Here is a practice assignment I have completed but seemingly not correctly. Can anyone offer advice as to my error? It compiles correctly but using some test numbers I only ever recieve that the circle has no x intercepts …

Member Avatar for noblepants
0
414
Member Avatar for paul9519

hi everyone i have a problem with this code below. when i try to read all the files in a directory i can but when i try to put them in a vector, it doesn't work, all the elements in the vector become the last element added. I'm not sure …

Member Avatar for Tumlee
0
212
Member Avatar for nquadr

Hi, I am trying to display the contents of a vector. The vector is defined from a class I created. I seem to be only storing the most recent values in my vector. I am not sure where my logic is incorrect. I am trying to store multiple objects in …

Member Avatar for nquadr
0
219
Member Avatar for jdh1231

Hi. I am pretty new to C++, and trying to understand how to use switch and case statement. So I was practicing with some bubble sorting algorithms, and it seems case 1 and 2 is not workig in my code. Can someone figure out why it's keep breaking please? The …

Member Avatar for NathanOliver
0
169
Member Avatar for mimah1

#include <iostream> using namespace std; char chessboard[100][100] ={' '}; int n; int savingposition[100][2]={ }; //checking rows.... bool checking (int row, int column){ for(int i = 0; i< n; i++){ for(int j = 0; j < n; j++) { if((j+i== column+row|| column - row == j-i || i== row || j …

Member Avatar for mimah1
0
153
Member Avatar for ekarem

Hi I would like to save integer values from 0 to n ( n = 112 e.g.) to a char array. How can I do this? char numbers[n]; for (int i = 0; i<= n; i++) { numbers[i] = i // or numbers[i] = 'i'; when I write code like …

Member Avatar for WaltP
0
225
Member Avatar for brahle

Always use scanf() and printf(). They are much, much faster than cin and cout. Also use stl algorithms, like sort, reverse and find, especialy if they are member functions of a container class you use.

Member Avatar for neithan
0
2K
Member Avatar for khuzdaar

We have started Object Oriented Programming in C++. And it has been four weeks. We were taught about Constructors, copy constructors, operators overloading functions, binary/unary and ofcourse, basics about classes. I need to get a project approved by teacher. She still has to teach us Inheritance. So we still know …

Member Avatar for deceptikon
0
577
Member Avatar for ztdep

Dear friends: I check the value range of double and long double with vs2010, but it gives me the same value. could you please tell me how to use the long double format in vs2010. Regards

Member Avatar for Ancient Dragon
0
994
Member Avatar for muhammad.khan.3576

// i dont know where i am getting wrong..the answer is contniously zero...plz help me #include<iostream> #include<cstdlib> using namespace std; int rand_val() { return rand()%1000000+10000; } int main() { int i,j; int salary_vec[100]={}; for( i=0;i<100;i++) { salary_vec[j]=rand_val(); } double tax_vec[100]={}; for( j=0;j<100;j++) { if(salary_vec[i]>=70000) { tax_vec[j]=salary_vec[i]*(10/100); } else if((salary_vec[i]>=50000)&&(salary_vec[i]<70000)) { …

Member Avatar for muhammad.khan.3576
0
193
Member Avatar for sadi.ak.351
Member Avatar for np complete
0
39

The End.