49,766 Topics

Member Avatar for
Member Avatar for love_you_4rever

I got stuck :(. Can anyone tell me the **purpose** of this following code please? (Suggest descriptive names for the function and its parameters.) int mystery(int x, int y[], int z) { for (int i = 0; i < z; i++) { if (y[i] == x) return i; } return …

Member Avatar for WaltP
0
112
Member Avatar for DaedalusK71

Hello everyone and thanks in advance for your help. I am relatively new to programming and I have decided to do a project to solidify what I have learned in school. Here's my problem... I want to create a combobox where, when you make a choice another combobox becomes visible …

Member Avatar for Ancient Dragon
0
110
Member Avatar for triumphost

Why does my checksum not work? I use it on my computer with ATI graphics and it works perfectly fine. When I switch to a computer with Intel graphics, it starts doing random values and they aren't the same. I switch back to my comp, the values are still the …

Member Avatar for triumphost
0
222
Member Avatar for Xeros

Hi. I have completed a program that plays a Zero Gravity Floating Connect Four. I.E. it can take checkers from the bottom, top, left, or right sides. It works, however, the win conditions do not seem to be working. I am not sure where the problem lies. #include <iostream> using …

Member Avatar for WaltP
0
1K
Member Avatar for Pyler

Could some one point out what's wrong with the classes of this program? #include <iostream> using namespace std; class box { private: int height; int length; int width; public: box();//constructor int surface_area(); int volume(); void set_dim(int ,int, int); }; //implementation box::box(){ int height; int width; int length;} box::int surface_area(){ int …

Member Avatar for WaltP
0
2K
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
309
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
125
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
68
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
195
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
297
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
294
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
241
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
230
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
257
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
286
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
747
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
232
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
108
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
217
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
180
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
57
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
91
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
596
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
184
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
183
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
279
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

The End.