Anonymous
true means function is on and false means function is off and 0 == off
Morax
true means function is on and false means function is off and 0 == off
Yes, I'm clear with this. Just comparing terminologies.
Morax
Like return 0 should have been unsuccessful... (0 is false).
Anonymous
0 means successful termination that's because 0 means off
Morax
Sorry if it's dumb question... But couldn't help asking about it...
Anonymous
no worry
I use Arch
Why return 0 signifies successful termination whereas anything other than zero unsuccessful termination? Asking in reference to the general terminology that 0 is false and non zero is true?
Because any other number can be an error code and 0 means that no error code was thrown which is success. It's UNIX standard
I use Arch
Why return 0 signifies successful termination whereas anything other than zero unsuccessful termination? Asking in reference to the general terminology that 0 is false and non zero is true?
And also casting numbers to boolean happens like you wrote: 0 becomes false and any other value becomes true because of logic that 0 means nothing (off/false)
Morax
@i_use_arch_btw got it. Thanks!
I use Arch
Is it really a Unix standard or is it just POSIX thing?
As I know it's a UNIX standard but maybe I am wrong, you can use Internet for finding out
klimi
As I know it's a UNIX standard but maybe I am wrong, you can use Internet for finding out
It just doesn't make sense to me that why others would be using Unix standard... That was it
I use Arch
It just doesn't make sense to me that why others would be using Unix standard... That was it
Why not? Standardisation through different things is something that is very convenient for programmers and users
klimi
Why not? Standardisation through different things is something that is very convenient for programmers and users
Well yes... But.... Why make standard from an implementation of standard? Aka POSIX
shinu
I need to make CreateRandomArray and FindMax methods, but I don't know how to help #include <iostream> #include <cstdlib> using namespace std; const int N = 100; int main() { int mass[N], max; cout << "Elements: "; for (int r = 0; r < N; r++) { mass[r] = rand() % 99;//CreateRandomArray cout << mass[r] << "|"; } cout << endl; max = mass[0]; //FindMax for (int r = 1; r < N; r++) { if (max < mass[r]) max = mass[r]; } cout << "Max: " << max << endl; return 0; } its c++
Anonymous
I’m so sorry about that but is there anyone know differential equations?
klimi
#ot
Samir
Hi. You can write and run codes of c++ in Turbo C++, Dev c++, code block, Microsoft visual C Plus.....
100$ website
100$ website
following
Denis
If all elements are negative
Anonymous
i have 4 Attributes day month year notice per line I want read day month year and notice seperate but the problem is how can i read notice seperate when it has Spaces do i need fgets ?
Anonymous
Hello
Anonymous
hi
Anonymous
I have a problem here with my Amazon gift card
Anonymous
Can I get help please
Anonymous
I can't help you with that stuff
Anonymous
I know but please you could have an idea on how to go about it please sorry if I'm bothering everyone
Anonymous
I'm just worried
klimi
I'm just worried
#ot Unfortunately this group is not for an Amazon support, you can chat in the offtopic group but I am not sure if anyone here will be able to help you
Bhanu
Mr. Karun wants to implement an automated system to compute the factorial of a given number. Where Karun has studied the concept of factorial of a number in mathematics. Help him to implement the same in C Language and check the obtained factorial number is even or odd. If the obtained factorial is even the print Even Factorial else Odd Factorial.
Bhanu
Please tell me ans fast gaa
Bhanu
Hlo
Spirit
Please send code
Please send money
Compiler🇮🇷
Hi
Compiler🇮🇷
Write a function that uses pointers to search for the address of an assumed integer in an array. If the assumed number is found, the address function takes it and otherwise returns nullra ?????
Compiler🇮🇷
Write a function that floats n pointers and returns an array that contains n floats.???????
Compiler🇮🇷
Floats pointers? What?
n Pointer to receive float
\Device\NUL
n Pointer to receive float
did you understand how pointer works ?
I use Arch
In fact no
https://lmgtfy.app/?q=how+do+pointers+work+in+c%2B%2B
Hsn
Start learning step by step .. dont try to jump to the results ..
Anonymous
can I ask java questions here or not ?
Anonymous
/get cbook
Compiler🇮🇷
Start learning step by step .. dont try to jump to the results ..
Well, you can only answer these questions for me
Hsn
Well, you can only answer these questions for me
You didnt even ask. You typed some words and put question marks after them.
Compiler🇮🇷
https://lmgtfy.app/?q=how+do+pointers+work+in+c%2B%2B
Can I send a personal message to Weston and help me?
Hsn
Im not going to write a code for you . You can ask reasonable logical questions no matter what level you are on. People tend to help
Hsn
Learn about pointers first
Hsn
Compiler🇮🇷
Compiler🇮🇷
Hsn
https://lmgtfy.app/?q=how+do+pointers+work+in+c%2B%2B
Check this one .. maybe play with arrays and pointers first ..
Ritesh
#include<stdio.h> #include<stdlib.h> struct number{ struct integer{ int a,b,c; union character { char a,b,c; }ch; }i; }no; int main() { printf("integer a = %lu\n", sizeof(no.i.a)); printf("integer b = %lu\n", sizeof(no.i.b)); printf("integer c = %lu\n", sizeof(no.i.c)); printf("char a = %lu\n", sizeof(no.i.ch.a)); printf("char b = %lu\n", sizeof(no.i.ch.b)); printf("char c = %lu\n", sizeof(no.i.ch.c)); printf("size of ch = %lu\n", sizeof(no.i.ch)); printf("size of i = %lu", sizeof(no.i)); printf("size of number = %lu", sizeof(no)); }
✨Justina
#include<iostream> #include<fstream> #include<string> using namespace std; int main() { string inputFile, outputFile; //prmpt user for input file cout << "Please enter a file name for input file: "; cin >> inputFile; //open file to write content ofstream inFile(inputFile); Why cannot use ofstream inFile(inputFile); ???
I use Arch
in code size of struct allowed 13 byte but it shows 16 to struct
Do you know something about data alignment? https://www.geeksforgeeks.org/structure-member-alignment-padding-and-data-packing/
✨Justina
Still can’t run it
I use Arch
Like /home/user/projects/file.cpp Or D:\Projects\File.cpp Depending on your system
✨Justina
Okay thank you ☺️
I use Arch
Okay thank you ☺️
If you want to write not a full path - make sure that file exists in the same folder as program executable or just learn how to access file in the needed directory