49,761 Topics

Member Avatar for
Member Avatar for logicmonster

I'm trying to come up with a small block of code that simply takes a character value that is input by the user and then use an "if" statement to determine what is excecuted depending on what is entered. I just started C++ this week and have no prior experience …

Member Avatar for lance p
0
305
Member Avatar for phorce

Hello, I'm just wondering whether or not, it is possible to get the vector Dimensions without them being set? Basically, I'm converting some matlab code and there's a function size(VECTOR) which get's the dimentions of the vector being passed. For example: #include <iostream> #include <vector> using namespace std; int main(int …

Member Avatar for WaltP
0
124
Member Avatar for Roshaan.N

Hi, i am new on vb.net.i want to link two forms. a button on form 1 when clicked it opens form 2 but not in new windows but it replace form 1 on the same window.

Member Avatar for Reverend Jim
0
67
Member Avatar for hhilo2002

Hi all, class A { public: A(); ~A(); } class B { public: B(); ~B(); private: A *a; ->declares a pointer to class A object A a; -> holds the class A object } Whats the difference between the 2 type of declaration of a class A instance? Are there …

Member Avatar for neithan
0
192
Member Avatar for coolikedat99

I am trying to create a program that converts a fahrenheit number to a celsius number, and convert a celsius number to a fahrenheit number. It takes user input and decides which sub-program to run depending on which letter is entered. Once it decides this, it asks for the number …

Member Avatar for NathanOliver
0
294
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
256
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
281
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
592
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
183
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
277
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
813
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
263
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

The End.