Anonymous
ah ok
I_Interface
C doesn't have classes. I think she needs it in C
struct Name { int[size] yourArray; int size; }
Anonymous
Does she need an array of structs or an array inside the struct?
I_Interface
I_Interface
I’ve a italian track not english, and google traslate has translate like this
Do you need an array of struct objects or an array inside a struct?
Anonymous
I’ve a programme where C++ is created in language a struct of 10 elements of this kind: a char and a int . It is: to load the elements into the vector by asking for values from the user; to print all elements of the vector; it is to add all the entire parts contained in the codes and print the sum by video.
Anonymous
is that understandable now?
Anonymous
"it is to add all the entire parts contained in the codes and print the sum by video." I can't understand this.
Anonymous
"add all the entire parts contained" so all 10 ints and 10 chars to make a string?
Anonymous
Lol. You said C just before.
let's just use C++, C will require to write struct all the time ( typedef will make it easier to read but typedefs aren't usually recommended )
Anonymous
What does whole parts mean now?
Anonymous
i don’t know
Anonymous
So you mean the user can input ints, floats etc?
I_Interface
Push elements to vector from a user and print their sum.
Anonymous
Well you have to use a void pointer now.
Anonymous
yes
Anonymous
Push elements to vector from a user and print their sum.
duh, vector v, v.pushback() in a loop, accumulate
I_Interface
So you mean the user can input ints, floats etc?
What the hell, why do we need a sum of numbers and symbols?
I_Interface
I don't get it. xD
Anonymous
What the hell, why do we need a sum of numbers and symbols?
Well so basically, typedef struct { void* data; } VECTOR;
Anonymous
use malloc, typecast whatever you want, add and print
I_Interface
Anonymous
lmao I know
I_Interface
Better to use "using".
Anonymous
this is a school project
Anonymous
Better to use "using".
No, no. I am writing it in C
Anonymous
I know typedefs are usually frowned because they hide code but this is school stuff...
I_Interface
this is a school project
And your teacher asks you get a sum of numbers and symbols?
I_Interface
Rly?
Anonymous
Yes
Anonymous
is stupid
Anonymous
Sum of numbers and symbols???!!
Anonymous
Why?
Anonymous
numbers or letters
Anonymous
so take everything as char
I_Interface
numbers or letters
Okay, "or" is better.
I_Interface
so take everything as char
Or using "switch case" with variants what a user wants to add.
Anonymous
Sum of numbers and symbols???!!
Maybe answers will be number + collating sequence of the symbol
Anonymous
can someone do that exercise?
Anonymous
Is this correct? input: 1 2 4 a b 3 c output: 124ab3c
Anonymous
Hence symbols be treated as char
Anonymous
I_Interface
can someone do that exercise?
Show us input and output data example.
Roshan
Hello! Can I share a screenshot of my question and then I'll give the link of my code?
Anonymous
my date is only, struct code 10
Anonymous
and i v’e got 1 chat and 1 int
mov $22, %rax
Certainly not in writing a += b -= a = b - (a = a % b)
I wrote it in assembly too https://paste.ubuntu.com/p/8MPj3NF4PM/
Anonymous
Meh Using at&t syntax for x86 assembly
Roshan
Giving the link to code...
Anonymous
Is this correct? input: 1 2 4 a b 3 c output: 124ab3c
I don't do c but you can only add up numbers and characters as strings or numbers plus characters treated as char
dj
is recursion fast as looping on c?
Roshan
Are photos not allowed??
Roshan
Are photos not allowed??
How to send question?? It's not copyable...
Anonymous
mov $22, %rax
Roshan
use https://paste.ubuntu.com/
😒 You want me to write the question??
mov $22, %rax
Anonymous
A screenshot will do
mov $22, %rax
Anonymous
is recursion fast as looping on c?
depends on hardware, generally no. Loops are way more efficient.
Prince Of Persia
Hi I have a class named MyChar it contain a char in it self as holder How can I do this? char b = 'c'; MyChar& a = b; A reference for char with my class
Anonymous
No
Prince Of Persia
Thanks😔
ברני
Thanks😔
What is the full task?
Prince Of Persia
I want to create a set of classes
Prince Of Persia
A Char class and String class
Prince Of Persia
I want to use std::string in my String class
Prince Of Persia
So operator [] need return a Char reference
Prince Of Persia
For this