49,757 Topics

Member Avatar for
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
280
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
340
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
87
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
180
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
266
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
331
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
200
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
251
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
129
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
Member Avatar for DSTR3

I'm using C++ VS 2010 in Win7. I'm trying to delete a zip. and/or txt. file that is less than a minute old. However; heres the rub. I don't know the name or location of the file. Only that I want to delete it by extension and a timestamp of …

Member Avatar for DSTR3
0
2K
Member Avatar for Vidgie65

Here is my code I am working and I cant for life of me get it to print if the year entered is a leap year or not. Please help me fix this.[code]#include <iostream> using namespace std; class dateType { private: int dMonth; int dDay; int dYear; public: void setDate …

Member Avatar for Taywin
0
284
Member Avatar for jammmie999

Hey Guys, I am trying to call a function in my DDL file [code] char DLL[1024]; _getcwd(DLL, 1024); strcat(DLL, "\\LoremIpsum.dll"); HMODULE Test = LoadLibrary(DLL); PluginEntry Entry = (PluginEntry)GetProcAddress(Test, "PluginEntry"); Entry(); FreeLibrary(Test); [/code] yet on Entry(); I get an access violation in 0xC0000005. What am I doing wrong? Thanks

Member Avatar for jammmie999
0
766
Member Avatar for D.M.
Member Avatar for Labdabeta

I have this problem: [CODE]struct Position { float x; float y; float z; }; bool CheckCollision(Position *vertices, int numvertices, Position start, Position end) { //return true if there was NOT a collision with the polygon defined by the vertices and the vector defined by the two positions. }[/CODE] I dont …

Member Avatar for Labdabeta
0
211

The End.