49,757 Topics

Member Avatar for
Member Avatar for Satya1994

Which is the best compiler for C++ development for latest versions of OS like the 64 bit windows? The DEV C++ compiler is a good option but I find it problematic for file handling. Visual C++ is also a good alternative but I couldnt find any command for compiling and …

Member Avatar for DavidB
0
292
Member Avatar for np complete

I'm coding a encryption program where I need to generate random prime. I wrote this code for(i=3; i<10000000; i=i+2 ) { for(j=2; j <= sqrt(i); j++ ) { if(!(i%j)) break; } if (j>sqrt(i)) { cout<<i << " "; } } This tests a number till is square root. Its good …

Member Avatar for TrustyTony
0
238
Member Avatar for Thornx1

I am currently in school for video game design. I plann to make a mmorpg and although I will be creating the company I plann to do much of the work involved. I have noticed lots of mmorpgs have bots running non stop flooding the game and making gameplay annoying …

Member Avatar for WaltP
0
228
Member Avatar for ahmed.alsalihi.3

Hi, Im stuck, Im trying to make a program that asks the user for a decimal number and then it converts it to a binary number. Im assuming I need a "remainder = string % 2" or something along these lines but Im not really sure where to start. anyhelp …

Member Avatar for WaltP
0
255
Member Avatar for Rasool Ahmed

Hi guys, as you know we can get a value from array by giving an index: int x[10]; int i; for(i=0; i<10; i++) x[i]=i; print(x[1]); // output is: 1 but how can I change this code to this: int x[10]; int i; x['a']=0; x['b']=1; x['c']=2; . . . x['z']=23; print(x['c']); …

Member Avatar for Rasool Ahmed
0
279
Member Avatar for empror9

hello, i'm writing a code for non-preemptive shortest job first, everything is okay except to select the first process arrived in the queue. here is my code. #include<iostream> using namespace std; struct process{ int processId; int burstTime; int arrivalTime; }; int main(){ int numberOfProcesses; //number of process cout <<"please enter …

Member Avatar for empror9
0
746
Member Avatar for shanki himanshu

#include<iostream> #include<math.h> using namespace std; int main() { long int t,n; cin>>t; while(t--) { cout<<"abc"; } return 0; } i am getting run time error for t>10000. how to solve it. range of t>1000000

Member Avatar for shanki himanshu
0
230
Member Avatar for paulsoncole

**i have problem in setting an alarm program, when i write the code to set with the alarm with the system it did not goes through so what should i do to fix the problem. pls i need to fix it if you can send me the code i will …

Member Avatar for deceptikon
0
107
Member Avatar for np complete

How can I make my program generate random number between two given integers ? I use `srand ( time(NULL) );` `x = rand() % i;` to generate numbers modulo i. But I can't figure out how to generate between two numbers, suppose 1 and 3.

Member Avatar for deceptikon
0
215
Member Avatar for roland.ahsue

You are required to write a program in C that will simulate the game of blackjack between two players. The computer will not be a participant in the game but will only deal the cards to each player and provide them with one or more ‘‘hits’’ ,that is additional cards …

Member Avatar for deceptikon
-2
176
Member Avatar for charisa mae

write a program to score "paper*rock*scissor"game.each two user type'P',R'or S, AND THE PROGRAM ANNOUNCES THE WINNER AS WELL AS THE BASIS FOR DETERMINING THE WINNER "paper covers rock","rocks break scissor",scisor cuts paper", or "nobody wins"be sure to allow the user to use lower as well as uper case letters.

Member Avatar for iamthwee
0
56
Member Avatar for shanki himanshu

i have made a queue using STL. the queue contains strings only. how to check for a particular string if it present in queue or not?

Member Avatar for Ancient Dragon
0
90
Member Avatar for henicken

wriite a program which accept amount as int yotaeger and displaytotal number notes of birr.100,50,10,5 and 1.

Member Avatar for DeanMSands3
-1
122
Member Avatar for infantheartlyje

Shall i create a cgi script with main function command line Argument ? If i can , How can i pass the data to this command line arguments ? And shall i pass Array of data from JavaScript to cgi-script which is created in c++. How many ways are available …

Member Avatar for Ancient Dragon
0
585
Member Avatar for triumphost

I keep getting "None of the 6 overloads could convert all arguments". I only get this problem in visual studio though. When I compile with g++ or codeblocks, it works perfectly fine. The code I'm calling my templates with is: `MemDeSerialize(ListOfItems, SerializedData, size_t(Data[2]));` The definitions: template<typename T> void MemDeSerialize(T& Destination, …

Member Avatar for mike_2000_17
0
182
Member Avatar for userIT

Given the trace program below. I basically need to store a 1 or a 0 to the corresponding `a[r[i]]` the problem is I need to be able to keep track of the index of vectors zero and one to check the last index that was used for each vector. For …

Member Avatar for userIT
0
181
Member Avatar for dot_binary

Does anyone know of a header file for windows with a function that enables the execution of code once every specified number of milliseconds, something that can be used like this: if ( delay(5) ){ // do something every 5 milliseconds } If it's in microseconds is even better. If …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for phorce

Hello, I'm trying to read the header information of a .wav file and I'm kind of stuck. Basically, the header information is located at different offsets in the file. So for example: (0-4) = ChunkID (4-8) = ChunkSize (8-12) = Format .. .. .. .. .. .. From this: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ …

Member Avatar for np complete
0
276
Member Avatar for henicken

Write a program which accept days as integer and display total number of years,months and days in it? ex. If user input as 856 days the output should be 2 years 4 monthes 6 days.

Member Avatar for np complete
-3
89
Member Avatar for henicken

1) write a program that reads a positive integer k,and output is propr divisors. ex. k=28,the proper divisor ar 1 2 4 7 14 28.

Member Avatar for NathanOliver
-3
51
Member Avatar for np complete

This is the famous counterfeit coin game in C++. # include <iostream> # include <cstring> # include <ctime> # include <cstdlib> # define coinVal 2; using namespace std; void gameInfo(); void generateGame(); void playGame(); int coins, counterfeitCoin; char typeOfCounterfeit; int main() { gameInfo(); generateGame(); } void gameInfo() { cout<<" Enter …

Member Avatar for np complete
0
809
Member Avatar for amar11372

In my hw problem there is this code #include <iostream> using namespace std; int fun(int x) { if (x <= 0) return 0; if (x >= 9 && x % 2 == 1) return x - 1; if (x >= 9 || x % 3 == 0) return x - …

Member Avatar for DeanMSands3
0
122
Member Avatar for triumphost

What are some safe sized datatypes? Inother words, stuff like size_t, uint32_t. They don't seem to change no matter what machine I use. I'm asking because the confusion comes in here: I'm not sure when to use long vs int. I did a sizeof(int) and sizeof(long) and they are both …

Member Avatar for deceptikon
0
157
Member Avatar for boiishuvo

I made a simple program - conservative sequence integers with a sum, for example input: 15, the output should be 1, 2, 3, 4, 5 I made this program in c++ and it worked successfully, see below: #include <iostream> #include <string> using namespace std; int main() { int num, i, …

Member Avatar for Taywin
0
259
Member Avatar for Harshini Divya

create a rectangle and find its area=w*h.create another rectangle with width and height as twice as the first rectangle and find its area using friend function in c++

Member Avatar for Lucaci Andrew
-2
206
Member Avatar for clarisaduta

llo all,* im trying to build a simple software to modify words. from undesirable content from the internet for example : f*cking into sexual intercourse or something like that im very new into programming so any ideas would help me a lot. thanks

Member Avatar for Lucaci Andrew
0
245
Member Avatar for jakkaprashanthi

**Bold Text Here**please send a c++ program to implement stack push and pop operations using random number generatos

Member Avatar for Lucaci Andrew
0
155
Member Avatar for kneiel

[code] class A { public: A() { cout<<"ctor A\n"; } virtual void func(int x) { cout<<"\nsj\n"; } }; int _tmain(int argc, _TCHAR* argv[]) { A objA; int *vptr = (int *)*((int *)&objA);// address of the virtual table typedef void (*fnptr)(int); fnptr f; f = (fnptr)*((int *)vptr+0);// address of func() within …

Member Avatar for AliceJohn123
0
678
Member Avatar for vivekarora

Hello Friends, As we know, when we have virtual function in our class, compiler smartly puts vptr(virtual table pointer) in our class to access correct function at run time. Can i access this vptr in my program, to use/manipulate this directly? Regards, Vivek

Member Avatar for AliceJohn123
0
3K
Member Avatar for phorce

Hello, wondering if someone can help me. I'm working with a .wav file, and, I need to collect the header information. The header contains (roughly, 20 bits/bytes) before the actual data. And, each of this data is contained at different locations in the file. I need to read a particular …

Member Avatar for phorce
0
175

The End.