Beginners - June 2021 (Page 7)

by greg98
how to solved the problem with check winner in tictactoe
 
Hi guys. I started the TicTacToe nxn project. I thought the program was working properly because entering 5 of the same characters vertically, horizontally or d...
[19 replies] Last: thank you guys! (by greg98)
by saam
Hash Function
 
I need a help to write a pseudocode for R1Hash(key, a, b, A, B, N) that takes non-negative integers key, a and b where a and b come from to the hashing function...
[10 replies] Last: @ jonnin thank you very much for the help. (by saam)
Ask the user if they want to rerun the program?
 
The problem is, we have to modify the code to ask the user if they want to run the program again. I already have a do-while loop set up, but I'm not sure where ...
[5 replies] Last: Hello morganniie, Always initialize your variables. You may be use to... (by Handy Andy)
by saam
Write a pseudocode
 
I am trying to write a pseudocode function R1(key, A, B, N) that takes a non-negative integer key, and arrays A and B of length N as inputs: the function should...
[3 replies] Last: In kbw's example he has an int named ret. In c++ when you want to retu... (by Manga)
by saam
pseudocode for hash function
 
Please someone correct me with my the below pseudocode. a pseudocode for R1Hash(key, a, b, A, B, N) that takes non-negative integers key, a and b where a and...
[no replies]
what datatype should i use in a function if the function is to choose something
 
Hi,may i know what datatype should i use in a function when the function is for user to choose either 2 choices. should it be boolean or should it be void? f...
[1 reply] : Possibly enum class PassReg {PassNum, IdentCard}; (by seeplus)
im totally new help!
 
hello guys, i need some help i start to use c++ like 1 hour ago im lost. i just need to create the most easy think but i have no idea how to do it i just ...
[9 replies] Last: The compiler and the method of compiling should most certainly suppor... (by kbw)
What's the meaning of 'int foo(int);'?
 
This question may sound strange. I'd found four kinds of initialization(value, default, direct, list) and tried many variable definitions which look similar. Be...
[5 replies] Last: If you want to print the function address you need to cast it to void*... (by dutch)
How Would I go about to write this? is it possible?
 
I just want to know if it is possible to write a program to create say an 'x' amount of emails where you are asked how many to create and you give lets say '6' ...
[6 replies] Last: @OP This has an even worse smell to it than spam. Generating passwords... (by againtry)
Bubble Sort for Strings
 
Hi so I wrote this code for my assignment and was confused as to why my bubble sort isn't working. Please tell me why isn't my bubble sort working and how do I ...
[10 replies] Last: Or sort the array in main() ... int main() { Property data {... (by againtry)
by jafra
index of value in table .c++
 
I have to create a function which receives in parameter an array of characters and a character. it must return the positions of this character in the array. I h...
[3 replies] Last: #include <cstring> // return the position of the character in the c-... (by JLBorges)
Finding an element in a vector of objects
 
Hi guys! I'm writing a program to create a simple database in C++. This program compiles, but it doesn't print any data. I think the problem is in the input fil...
[2 replies] Last: No, it compiles) I've forgotten to give you some very important parts ... (by crueltyfree)
Moving squares for a sliding puzzle with sfml
 
So I am making a sliding puzzle game with SFML in C++ and I am unsure what I am doing wrong to move these boxes. I there something wrong with the code I have? ...
[2 replies] Last: Yeah my question was how to move or flip both boxes around to make sur... (by bern077)
Linked List - How To Create From File
 
I am a CS student and currently stuck on an assignment regarding linked lists. I am supposed to take a functioning program that reads input from a file and cre...
[3 replies] Last: Thanks for the replies! I got it working. Thanks for the general C++ '... (by thedude0901)
by saam
Recursive function
 
Best and worst case inputs Recursive function (growth function) function Find(key,B,M,j) for 0 <= i < M if(B == key): return j + 2*i...
[8 replies] Last: Thanks @Ganado @jonnin. I've got it. (by saam)
by alexas
memory/references issue
 
I am again here with my struggle with pointers/references. I simplified everything to the two simple functions that compiles - but does not work as intended (t...
[10 replies] Last: it should work as-is with some includes. Test it first like it is, an... (by jonnin)
How to find a specific element of a value in a vector?
 
If I have 2 values being added multiple times to a vector like this : int one = 1, four = 4; std::vector<int> numbers{ one,one, one, four,four , one, four};...
[8 replies] Last: Okay, to fix it you have to use std::rbegin and std::rend instead.... (by mbozzi)
GetAsyncKeyState() confusion
 
if (GetAsyncKeyState(VK_NUMPAD1) & 1) i understand what the above function does , in its definition its written "If the function succeeds, the retu...
[2 replies] Last: thanks @markyrocks (by Reddevil1003)
can not create file
 
So i have problem with files. Idea is to open files with different names using one function, and write some data to them, also want them to have file extensions...
[5 replies] Last: lastchance, seeplus, Thank you very much! it seems that i misclicked... (by electro amperkin)
Help with this task
 
I need to write a program in Qt. Put a picture on the main window. And create a new file, write some text to the file, and display the recorded text on the scre...
[6 replies] Last: @OP FWIW this follows your snippet as a complete project which runs. ... (by againtry)
June 2021 Pages: 1... 56789
  Archived months: [may2021] [jul2021]

This is an archived page. To post a new message, go to the current page.