48,986 Topics

Member Avatar for
Member Avatar for ZombieKnight93

So I have a poker type program where it should shuffle and deal a deck of cards using arrays of pointers. I have to write a function that uses a pointer(s) to determine if the hand contains an Ace. If I can understand this one, I'd be able to do …

Member Avatar for tinstaafl
0
1K
Member Avatar for Zeeshan_10
Member Avatar for elifelo

I want to create a game that computer guesses the number that i think between 0-500 but i am a beginner and i do not know what to do could you help me please ?

Member Avatar for rproffitt
0
361
Member Avatar for Pujinraffh

program buys internet packages with credit (pulsa) with do while loop . Dev c++

Member Avatar for rproffitt
-2
142
Member Avatar for Addison111

I have some problems when working with Win32 api. 1. Changing the text and background color of a button doesn't take effect. My code: case WM_CTLCOLORBTN: COLORREF colorref; colorref = RGB(0,0,255); HBRUSH hBrushBtn; hBrushBtn = CreateSolidBrush(colorref); return ((LRESULT)hBrushBtn); break; 2. How do I create selectable text. My code: text = …

Member Avatar for tinstaafl
0
304
Member Avatar for Ati_1

Algorithm 1) Choose the time quantum and assign it for each process. 2) Allocate the CPU to the process according to the FCFS scheduling. 3) If (burst time of the process < time quantum).{Allocate the CPU to that process till it terminates.}Else {The process will occupy the CPU till the …

Member Avatar for rproffitt
0
318
Member Avatar for fanolots

Hey, I don't know if this is the right place, but my issue is taking an output from a software SPI and using it in another function for temperature. The code below is marked with my issue, however it's not the full code. The full code is for a lab …

Member Avatar for tinstaafl
0
312
Member Avatar for Addison111

I'm trying to setup mongoos server in a Winndows app. The server code needs to be in an infinite loop, so does the windows main loop. I put the server code and win loop on 2 threads, the problem is, the program hangs when executed. Is there a way to …

Member Avatar for rproffitt
0
433
Member Avatar for djbsabkcb

Question: I have to do a program on alternating sums using vectors. I am not sure how to start this program. I thought about using an array and every even index add the value and every odd index subtract the value. Does that sound right? Any ideas?

Member Avatar for jacklin
0
2K
Member Avatar for Nancy_16

I am using PySide2 for GUI. I have a "Rename Project" QAction. The function must be like this: 1. set enable to false if tab name is "*Untitled" or file is unsaved. 2. set enable to True if file is loaded. How to do this? 3. Whenever switching to tab, …

Member Avatar for jacklin
1
1K
Member Avatar for ZombieKnight93

How can I make this to continue until the user presses N? I've tried using while(1), while( option == 'y' || option == 'Y') but it kept giving an error for that, and if/else statements but no luck. So I decided to try a do while statement and same results, …

Member Avatar for Smith5646
0
852
Member Avatar for tony_28

Hi All, In this program I have these 2 matrices . It will compare each element in each row of matrix[4][4] to 3 . If that value <= 3 then store the characters in the first row of matrix m_c[25][32] in an 2D char array (char clusters[40][40]). For example 3 …

Member Avatar for rproffitt
0
537
Member Avatar for cambalinho

how avoid memory leaks? from here: http://www.winprog.org/tutorial/bitmaps.html i learned: GetDC() - ReleaseDC() BeginPaint() - EndPaint() CreateCompatibleDC() - DeleteDC() i must get the old selected object. select it when isn't needed and then delete it. so seen these constructor and desctructor: image(const int width, const int height) { if (isimgused==true) delete …

Member Avatar for Topiary
1
1K
Member Avatar for chandan_14

#include<iostream.h> #include<conio.h> class game { int a,b,c; public: void g() { cout<<"Enter value of a<<endl; cin>>a>>b; if(a<b) { cout<<a,<<endl; c++; } } }; void main() { game g1; g1.g(); getch(); }

Member Avatar for Reverend Jim
0
339
Member Avatar for nitin1

Hi, How can I pass a c# string to C++ side of the app? Right now, I have all handling in Const char * format . When I pass c# string, c++ working fine when using Platform::String . But there is no good way of converting Platform::String to const char …

Member Avatar for ddanbe
0
5K
Member Avatar for Wong_2

i'm newbie in the programming in language c++ can i know what the code of update function and delete function?I have no idea to do this 2 function someone can help me? please...

Member Avatar for Softvelopers
0
177
Member Avatar for Omama

Hi, below is my code for binary search algorithm. My question is, what if I enter more than 1 same numbers in the array? How should i modify my code to print out all the locations where that same number is found? For example, if I entered the number 2 …

Member Avatar for Reverend Jim
0
779
Member Avatar for Addison111

I have a web server app, and a client app that works like a browser. I get the desired response from the server app if I type my IP in the browser window, if I read the response to the client app I get an empty string. The client app …

Member Avatar for rproffitt
0
504
Member Avatar for Addison111

I'm trying to build a client and a server in the same program. For example, user 1 sends a packet of data to user 2, user 2 after receiving the packet sends back a different packet to user 1. The problem is, after running the program neither user receives the …

Member Avatar for kevenm
0
892
Member Avatar for arithehun

This is a tutorial, not a program. [b]Step 1[/B] First, create a file for your website, and name it "admin.html". [b]Step 2[/b] Now on it, say, "You must log in to view admin, blah,blah,blah. Click here to launch our client." [b]Step 3[/b] Link "Click here" with the C++ .exe file …

Member Avatar for Aaron_16
-5
15K
Member Avatar for brittany435

Hello, I am working on a small program that reads ten numbers, computes their average, and finds out how many numbers are above average. This is the set up I have so far: #include <iostream> using namespace std; int main() { double myList[10]; myList[0] = 89 myList[1] = 56 myList[2] …

Member Avatar for Reverend Jim
0
3K
Member Avatar for Melika_2

Having 2 integers, by using their decomposition we want to calculate their binary gcd algorithm Please help me to write a c++proram. Unfortunayely, due to sanctions against my country Iran I can' t pay!

Member Avatar for rproffitt
0
144
Member Avatar for student_x

Coin game: Alice and Bob are playing a game using a bunch of coins. The players pick several coins out of the bunch in turn. Each time a player is allowed to pick 1, 2 or 4 coins, and the player that gets the last coin is the winner. Assume …

Member Avatar for G._1
0
3K
Member Avatar for allen_1

#include<stdio.h> #include<conio.h> typedef struct process{ char pname[20]; int at,bt,wt,ta,end; }processes; int main(){ processes P[10]; processes z[10]; processes et[10]; processes wt1[10]; processes ta1[10]; int a,b,n,x=0,st,y,w; float aveta,avewt,sumta=0,sumwt=0; printf("Process Scheduling Algorithm:\n"); printf("SHORTEST JOB FIRST\n"); printf("--------------------------------------\n"); printf("Enter No. of Process: "); scanf("%d",&n); printf("\n"); for(a=0;a<n;a++){ printf("Enter Process Name P[%d]: ",a+1); scanf("%s",&P[a].pname); } printf("\n"); for(a=0;a<n;a++){ …

Member Avatar for Sahil Singh
0
629
Member Avatar for cambalinho

i have these GNU macro: #if defined __GNUC__ #define EVENT [[gnu::weak]] #elif defined __clang__ #define EVENT [[llvm::weak]] #endif #define IS_EVENT_DEFINED(sym) (static_cast<bool>(sym)) these macro works fine. and help me test if the function(even with a prototype) was defined. my problem is can i convert [[gnu::weak]] to Visual Studio code(for be compatible)? …

Member Avatar for rproffitt
0
412
Member Avatar for Olz_1

We need to implement this game MS Visual C++,using animation.You have scattered letters and from them you have to make up a word,if you guess the word you get n points(n=size of word) ,the button "hint " removes 3 points,from the accountant by prompting one of the letters ,a "new …

Member Avatar for Reverend Jim
0
238
Member Avatar for Aliyah_1

hello there. i needed a little help in writing coding for reading multiple lines of data from a .txt file that are seperated by commas. Student Name, Student ID, Mark Ada Lovelace , S001 , 99 Barbara Liskov , S0123 , 44 Carol Shaw, S0023 , 55 Donna Dubinsky , …

Member Avatar for rproffitt
0
611
Member Avatar for Aliyah_1

Hey. My question is to read from a csv file and provide a user functionality to sort and output the data by grades, name and student id.. The code is compiling and running. The trouble I am getting now is outputting the file to different files when being sorted out …

Member Avatar for Aliyah_1
0
261
Member Avatar for pato wlmc

Well, right now i'm following a tutorial on game making for c++, but is this really the best programming language for video games? Also i'd like to know if can recommend me a book ( i've seen some book on amazon but i don't really know wich one to choose …

Member Avatar for Reverend Jim
0
10K
Member Avatar for Meghna_1

**Question**Accept a character C and a positive integer N as input. The program must print N characters starting from C. Input Format: The first line contains C and N separated by space(s). Output Format: The first line contains N characters. Example Input/Output 1: Input: a 4 Output: abcd Example Input/Output …

Member Avatar for ddanbe
0
292

The End.