49,757 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
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']); … | |
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 … | |
#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 | |
**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 … | |
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. | |
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 … | |
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. | |
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? | |
wriite a program which accept amount as int yotaeger and displaytotal number notes of birr.100,50,10,5 and 1. | |
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 … | |
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, … | |
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 … | |
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 … | |
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/ … | |
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. | |
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. | |
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 … | |
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 - … | |
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 … | |
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, … | |
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++ | |
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 | |
**Bold Text Here**please send a c++ program to implement stack push and pop operations using random number generatos | |
[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 … | |
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 | |
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 … |
The End.