Arguments inside a C function
I am recently studying functions in C and I often notice (from online examples) that function in the main.c contains arguments with a different name than what they are called in the file in which it is declared.
How can a large function with state variables be broken down into smaller ones?
Should the state variables be passed around as pointers or should tail calls be used?
Replacing a function in a call to another function in C++
I am wondering about one thing.
I have code in a function that looks identical, except for one thing that differs depending on one variable.
I will use the example code:
Executing database query if button “Cancel” is pressed (C++)
SockectComm.cpp int retries = 6; while (retries > 0) { // Connect to server if (connect(sockfd, reinterpret_cast<sockaddr *>(&serv_addr), sizeof(serv_addr)) == SOCKET_ERROR) { std::cerr << “Unable to connect to server: ” << WSAGetLastError() << std::endl; if (retries > 1) { int result = MessageBox(NULL, “Няма връзка със сървъра, n Следващ опит след 10 секунди”, “Error”, MB_RETRYCANCEL […]
(Cs)What value do I have to give args in this function?
So some friends and me are programming a consolegame in Cs and I want to do a function (progressClick) which requires a int (in this case a coordinate for a rectangle) But it says that I dont have a correct value for the int even tho i gave them one (100).
difficulty in using errno to find wrong in open function
open function in my code doesnot work.
I already search stackoverflow and find a possible solution
How to include a comma in fscanf
i want to scan the line “Ryan, Elizabeth 62” with fscanf like this
getting an issue in my cpp raisetoPower function
#include <iostream> using namespace std; int raisetoPower(double x, int power){ double result; int i; result = 1.0; if(i == 0){ result = 1; } else if(i > 0){ for(int i = 0; i < power; i++){ result *= x; } } else{ for(int i =0; i > power; i–){ result *= x; } result = […]