Talula
Why ?
Because when you call a different memory area and pass on the value on stack, it takes more cycles compared to a loop, which is jumping with compare.
Pavel
Sum of 2d array sounds ambiguous: is it sum of all elements of an array or sum of two matrices
mito
Isn't this called pascal's triangle?
I remember someone asking the same thing in another group..
Deniz Özgür
#include <Windows.h>
#include <iostream>
int nScreenW = 120;
int nScreenH = 30;
int main()
{
wchar_t* screen = new wchar_t[nScreenW * nScreenH];
for (int n = 0; n < nScreenW * nScreenH; n++) { screen[n] = L' '; }
HANDLE hConsole = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
SetConsoleActiveScreenBuffer(hConsole);
DWORD dwBytesWritten = 0;
int i;
while (true)
{
for (i = 0; i < nScreenW * nScreenH; i++) { screen[i] = 0x2588; }
WriteConsoleOutputCharacter(hConsole, screen, nScreenW * nScreenH, { 0, 0 }, &dwBytesWritten);
}
return 0;
}
Deniz Özgür
I want to change command line row and column from nScreenW and nScreenH valuables
Deniz Özgür
Also character width, height and color how I can do?
Knights
Good evening
How do I check if an input is an integer
Thanks
ɛ n h ᴀ n c ɛ ґ 🧟♂️
Knights
Knights
I’ll try that
klimi
In your case the second option: strtol() might be better
.
Hello
.
can someone help me with this:
CI = p * (pow((1 + r / 100), t));
how should i change the formula if i want to find r?
Anonymous
.
Thank you!
Anonymous
Thank you!
Stick to C/C++ questions in the future. This is not a Maths group to help you with Compound Interest formula
Anonymous
Anonymous
Check MSDN it's great documentation for the Windows API
Deniz Özgür
Anonymous
Anonymous
Anonymous
Refer geeksforgeeks
mayway
Random_number=rand()%max+min;..
Random_number=rand()%(max-min+1)+min;.....
Whats the difference between them???
Pavel
Пингвинтус
Hello guys, I'm a beginner in programming and currently struggling with one task, if someone could help me, I'd very thankful (c++)
ruki
hi eveyone, now xmake has supported c++20 modules and analyze inter-module dependency compilation, and parallel compilation optimization welcome to try it. https://github.com/xmake-io/xmake/wiki/xmake-v2.5.9-released,-Improve-Cplusplus20-Modules-and-support-Nim,-Keil-MDK-and-Unity-Build
Suka
Gudisa Gebi
#include <iostream>
using namespace std;
struct Person{
int age;
struct Person*link;
};
void addAtEnd(Person *head, int x)
{
Person *temp= new Person;
temp->age=x;
temp->next = NULL;
//
Person *ptr= head;
while(ptr->next !=NULL)
ptr = ptr->next;
//
ptr->next=temp;
}
int main(int argc, char** argv) {
Person *head= new Person;
head->age=23;
head-> next= NULL;
//
addAtEnd(head,24);
addAtEnd(head,25);
addAtEnd(head,26);
return 0;
Gudisa Gebi
Ka. LOVE |• kalhim ng ilaw • TSV: Lokal ng SUCAT
what is wrong with code
If i choose number for magic tricks in the last part it will not show what i choose
Ka. LOVE |• kalhim ng ilaw • TSV: Lokal ng SUCAT
Try to run the code🥺
Talula
Anonymous
Anonymous
Probably a 'typo'
Angel Anne
Hi everyone can someone help me with this 🙏🏻🙏🏻
Create a c program that will perform the given below using array, conditional statements and loops.
-input 5 grades in an array
-determine if the input grade is passed of failed
-then count how many grades are passed or failed
Angel Anne
Anonymous
想改hosts
Anonymous
Anonymous
sizeof operator might work
Anonymous
Anonymous
Sizeof returns the size of bytes
ARx
or you can also use #define GRADES 5
Anonymous
There’s a len function in other languages I’m not sure what’s the best way of doing it, but it’s probably sizeof
ARx
That's more appropriate in generic programs, you can also declare a variable for length size_t length = sizeof(array) / sizeof(array[0])
The WARRIOR
What is .CPP and .h files in c++.
What is header guards and how it useful?..could someone help me
ARx
The WARRIOR
ARx
.h is a file which contain declarations of functions related to something, you can use for example a math header "math_functions.h" file where you declare functions as multiplication, add, power, etc
Shobhit
Is there any way to fix no file or directory find in vs code terminal????
....
ARx
ARx
then you can include the header, and you are able to use all the functions it contains
The WARRIOR
Tnxs Alan...👍👍
Shobhit
ARx
Shobhit
Shobhit
I just started coding
Not much familiar with vs cide
ARx
use pwd if you are in linux to know where you are
Shobhit
Anonymous
Please please check dm
It’s often useful to check the Linux Programmers manual for functions like printf for example man 3 printf or man 3p printf, the 3p section is the POSIX section but 3 is more relevant
Anonymous
and you can also learn about commands via man <command>
Anonymous
Hi everyone
Can you write any C programming that make the program end only when user enters “0 0 0”
klimi
klimi
what's the problem?
klimi
you don't know how to exit the C program? get the user input? compane 2 strings?
Anonymous
I dont know strings
Anonymous
Anonymous
As a string or char array
Anonymous
actually, i wrote a program but when i write 0 0 0, it doesn't end
ɛ n h ᴀ n c ɛ ґ 🧟♂️
ɛ n h ᴀ n c ɛ ґ 🧟♂️