49,761 Topics

Member Avatar for
Member Avatar for Kron

Ok, so basically I have an assignment in which I have to determine if what the user typed in is a number between 0-9, a letter or a symbol. The commands I can use are: [CODE]cout endl system("pause") system("cls") #include<iomanip> setw(#) setfill('ch') "\t" cin getline(cin,s) bool char int double string …

Member Avatar for Narue
0
237
Member Avatar for yup790

I was wondering which language should learn. I do not want to be a programmer for a job(at the moment I am a young teen) in the future, I would like to be a physicist. In the meantime though I would like to learn a programming language. I want to …

Member Avatar for JamesCherrill
0
254
Member Avatar for homeryansta

[CODE=C++]void List::remove_last() { if(first == NULL) { first -> data = ' '; } else { Node *newnode; newnode = new Node; newnode = NULL; newnode -> data = last -> back -> data; last = newnode; } }[/CODE] am I doing something wrong? I'm trying to remove the end …

Member Avatar for sunn shine
0
175
Member Avatar for bennetk2

[CODE] #include <iostream> #include <iomanip> // set width and decimal #include <fstream> // use file input and output #include <cstring> // use strings using namespace std; ifstream infile; ofstream outfile; string input(string, int); string copy(string, string, int); string breakup(string, string, string, string, int); string capt(string, string, string, string, int); string …

Member Avatar for vidit_X
0
991
Member Avatar for YaelGD

Hi, I need to draw a right triangle, based on the height and the base of it. An Isosceles one is easy to draw, but a randomly chosen relation between the height and the base (which gives me a right triangle other than 90, 45, 45) needs to be based …

Member Avatar for sungaw
0
2K
Member Avatar for vidit_X

I need to write a program, which prints out all the prime numbers between two numbers. The first input specifies the number of test cases, followed by the limits. Here is an example.. [QUOTE] Input: 2 1 10 3 5 Output: 2 3 5 7 3 5 [/QUOTE] I wrote …

Member Avatar for Rashakil Fol
0
154
Member Avatar for Stang51

Hi, I'm new here I searched for any possible way to fix my issues, but I have not found anything that I can understand, so I figured I would post my code here. In my C++ class I was asked to take a craps program and modify it to take …

Member Avatar for Stang51
0
1K
Member Avatar for khevz09

MY problem is ..... Given an input 'n' came from the user and display a pattern. but my code is very long .... my code is only for 1-10 numbers i need to display any numbers that input of the users can u give me some short code or advice …

Member Avatar for cejay2b20
0
1K
Member Avatar for justincuppen

Hello I need help figuring out how to write a loop program that behaves a certain way, I have been beating my head off of walls trying to figure this out and it is probaby so easy.. This is the expected behaviour: $ ./a.out Enter some text on 1 or …

Member Avatar for justincuppen
0
125
Member Avatar for justincuppen

Hello I am attempting to write a program that will convert temperature from c to f and vise versa. However I need this program to stop when choice == 'q' and i am having a horrible time with it. here is the code that i have been working with. any …

Member Avatar for vidit_X
0
147
Member Avatar for bobytch

Good Day Everyone here is my code so far [CODE] #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> void vp(int x,int tc,int bk,char *text); void square(int x,int y,int size); void main() {//=========================================================== int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, "C:\\TC\\BGI"); //------------------monitor-------------------- setbkcolor(0); setcolor(15); square(300,160,150); square(300,160,148); square(300,160,130); square(300,160,131); setaspectratio(2,5); int …

Member Avatar for vidit_X
0
281
Member Avatar for GSLENK

Program runs fine with me, the cout's work. IDK what this means every cout from line 17 to 71, and the system ("pause") on line 72 are all warning marked as ambigious. It started happenning when i put the "while (occupiedRooms > rooms)" in. I think thats when the errors …

Member Avatar for vidit_X
0
342
Member Avatar for Kron

Ok, so basically I want a program which can determine if what the user typed in is a number between 0-9, a letter or a symbol. The commands I have to make it with are: [CODE]#include<iostream> #include<iomanip> setw(#) setfill('ch') bool char int double string #include<string> #include<cmath> #include<windows.h> → directiva utilizada …

Member Avatar for NathanOliver
0
88
Member Avatar for toneatles

Hello all, I have a assignment for school that I am having trouble with. I have to write a program that will list all primes numbers of an inputted number. I have the code and it compiles with no errors, but when I run it after i input the number, …

Member Avatar for vidit_X
0
183
Member Avatar for temmyb

So I cant get the division to work on my c++ homework. This is a diceroll game and im trying to get sum1=num1/diceRoll to get the percentage of # of times divided by the amount of time the dice is being rolled. It keeps giving me 0 because I assigned …

Member Avatar for temmyb
0
207
Member Avatar for Vidgie65

These are the errors the compiler is giving me on these lines od code - any help understanding or fixing this issue ???? \extpersontype.h(35) : error C3646: 'extPersonType' : unknown override specifier \extpersontype.h(37) : error C2091: function returns function \extpersontype.h(44) : fatal error C1903: unable to recover from previous error(s); …

Member Avatar for Moschops
0
264
Member Avatar for syaminismail

1) Write a full program for the bubble sort algorithm. User is required to enter specific input numbers and the program will be able to sort the given numbers in ascending order. Write down in a table the time (according to your system clock) that it takes for the program …

Member Avatar for Narue
0
223
Member Avatar for Zvjezdan23

This is code for building a white window in direct X. The problem is, when I debug, I get this error. 'Chapter1_DirectXWindow.exe': Loaded 'C:\WINDOWS\System32\uxtheme.dll', Cannot find or open the PDB file The program '[2536] Chapter1_DirectXWindow.exe: Native' has exited with code -1 (0xffffffff). [CODE]#include <Windows.h> LRESULT CALLBACK WndProc(HWND hwnd, UINT message, …

0
76
Member Avatar for dospy

i've seen many programs using printf( ) for outputing(probable ported from C) but anyway, is there any difference between printf and cout? also i've seen many functions(expecially in windows.h) using w_char*(wide char string) as arguments or return value(and it bugs me because it makes difficult to use with strings) what's …

Member Avatar for dospy
0
268
Member Avatar for ntrncx

1) what exactly is the difference in a constructor if you put reference on it? example[CODE]ConstructorX(string first):firstName(first)[/CODE] with [CODE]ConstructorX(string &first):firstName(first)[/CODE] 2) [CODE]const Array &operator=(const Array&)[/CODE] the first const what exactly means?the const in the parenthesis is that the object is constant if its at the end means the function cannot …

Member Avatar for dospy
0
225
Member Avatar for DSTR3

I have a map that is not returning the correct number. First it did, then it didn't now it's just messed up. Any help is appreciated.Thanks. [CODE]struct file_data { std::wstring sLastAccessTime; __int64 nFileSize ; }; int GetFileList(const wchar_t *searchkey, std::map<std::wstring, file_data> &map) { WIN32_FIND_DATA fd; HANDLE h = FindFirstFile(searchkey,&fd); if(h …

Member Avatar for MonsieurPointer
0
271
Member Avatar for L0s3r

Hi Guys. Random no.'s always bother me.So,I want to start a discussion over their uniform distribution. Given : rand5() which generates randomly distributed no. from 1-5. To Code: rand7() which generates randomly distributed no. from 1-5. You have to give code using rand5() as well as without using it. Thanks,

Member Avatar for StuXYZ
0
160
Member Avatar for ctjh900801

I am using VB.net to develop an application, but there needs to be applied to the dll technology. So come here to seek help. First I will describe the features I need this dll I want to monitor an application's window to get in on a PSD_ENVSTAMPRECT the lParam value. …

Member Avatar for ctjh900801
0
332
Member Avatar for ussra2

I have looked around the website using the search and have seen old post so I am posting a new question most likely to an old answer. I am trying to read data from a file into an array and then pass it on to a function. I also have …

Member Avatar for WaltP
0
956
Member Avatar for teo236

how can I sleep my program without sleeping others (or making them slower)? I am using a windows application. here is a fragment of my code: [CODE] //#includes... int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, char * cmdParam, int cmdShow) { MSG msg; int status; Window myWind(SW_SHOW,"Name",150,120,500,0); for(int i=0;i<550;i++){ myWind.setLocation(i,i); …

Member Avatar for teo236
0
201
Member Avatar for Mahkoe

So I'm trying to achieve this myself, but I decided to ask on this forum to see if anyone knew about some obscure project on sourceforge or something that did exactly this: I need to store very large numbers and perform arithmetic on them. I am storing the values in …

Member Avatar for mike_2000_17
0
253
Member Avatar for _dragonwolf_

I'm not exactly sure what is wrong with my code. It will run and then it stops without completing the maze. Any ideas? Thanks in advance. Here is my code: [CODE] #include <iostream> #include <ctime> using namespace std; void mazeTraverse(char [][12], int, int); int main() { char maze[12][12] = { …

Member Avatar for triumphost
0
187
Member Avatar for bmanzana

[CODE]#include <iostream> #include <iomanip> #include <string> #include <cmath> using namespace std; int main() { double accNum; string scode; string scodeab; double minu; double minam; double minpm; cout << fixed << setprecision(2); cout << "Please enter account number: " << endl; cin >> accNum; cout << "Please enter service code: P(for …

Member Avatar for doug65536
0
131
Member Avatar for cossay

Anytime I try to compile the code below I get the following error message. E:\Users\Cosman\Desktop\C++ PRACTICE\read2.cpp|52|error: no match for 'operator<<' in 'std::cout << m' How do I correct this? [CODE] #include <iostream> #include <fstream> #include <cstring> using namespace std; class A { private: char name[50]; char gender[8]; int age; public: …

Member Avatar for cossay
0
115
Member Avatar for valestrom

I have multiple errors in my code that I was just working on, the errors are as follows: Here is my build log: monsters.h:11: error: storage class specified for field `enemyattack' monsters.h:11: error: ISO C++ forbids initialization of member `enemyattack' monsters.h:11: error: making `enemyattack' static monsters.h:11: error: ISO C++ forbids …

Member Avatar for mike_2000_17
0
360

The End.