Anonymous
please help me
Yakov
Hey guys. I have a question that I don't even know how to google. So, if you are giving to some void function pointer array you can do whathewer you want w/ it and access from any other function. BUT I like vectors a lot and to do the same thing I create vector<> functions and return the given array. But that's inconvinient as fuck. Is there's a better way?
Yakov
example:
01000001011011010100000101101110
example:
But it's better to pass the vector as reference.
Yakov
But it's better to pass the vector as reference.
I don't understan exactly how to.
01000001011011010100000101101110
Void function ( vector<int> &inputArray) { // Do here // No return }
01000001011011010100000101101110
example:
As the change will be made in original vector you dont need to return it again
Yakov
Like that?
01000001011011010100000101101110
Like that?
It works?
Yakov
It works?
Seems to.
Yakov
Yeah it's working. Thanks you a lot, gonna read about references and pointers.
01000001011011010100000101101110
Great!
What does this mean Variable 'c' used in loop condition not modified in loop body. I can't seem to understand the explanations on the internet
Code?
for (count = 0; (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); count++)     {               }
MilkBeforeCereal
this is a warning I assume?
MilkBeforeCereal
you can probably fix this easily
full code
#include <stdio.h> #include <cs50.h>     int main(void) {     int count;     char c = 'a';     //Prompts user for text     string s = get_string("Text: ");        for (count = 0; (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); count++)     {               }       printf("%i letter(s)\n", count); }
MilkBeforeCereal
what's this program supposed to do?
what's this program supposed to do?
I'm trying to write a code that counts the number of letters in a given text
MilkBeforeCereal
I'm trying to write a code that counts the number of letters in a given text
you're not using the string anywhere in the loop tho?
I'm clueless
MilkBeforeCereal
How do you count the number of alphabets in a real string?
MilkBeforeCereal
you read from the beginning till the end, character by character
MilkBeforeCereal
for that you need the length
MilkBeforeCereal
so find the length first
01000001011011010100000101101110
See the thing is, You must start the loop from 0 i.e. index 0 of string.. To length of string
Then you must use a if() condition to check if it is a chat or not
MilkBeforeCereal
compare to character set and increase count
01000001011011010100000101101110
Дмитрий
hi ,when i use overload operator + in construction (1 object_matrix +another object _matrix ) i contained them in first how can i make containing to another third object look like a=c +b
Дмитрий
gallo
Why in destructor do you do after the For delete[] ->array_matrix
Dima
oop stuff
Dima
kinda safety
Dima
compile time stuff
NXiss7
Don't wanna use C#. Don't want to get bound to a company... C++ is more "cross-platform"... You can use both low-level stuff and hifh level stuff at yhe same time, seamlessly...
NXiss7
Yep
NXiss7
But why bother C# when you can just use C++? Create smaller exes single exes... 😄😄
Дмитрий
Why in destructor do you do after the For delete[] ->array_matrix
i delete all matrix but in first part there there is for i delete massive in matrix
gallo
Doing delete[] this-> array_matrix[i] row times is sufficient
Yakov
C# is Microsoft. Fuck Microsoft.
Yakov
Lol bruh look at your username
NXiss7
C# is Microsoft. Fuck Microsoft.
YES! Fuckingh YES! I don't wanna be a slave to bitch
NXiss7
Try using C# on Android
Dima
(is awful)
NXiss7
Apple platforms...
Dima
(is awful, twice)
Dima
oh wait.. mac actually has native support for c#
NXiss7
Mono
Yeah, it's fucking awful That's why you can trust good old C++.
NXiss7
oh wait.. mac actually has native support for c#
I dunno, I don't even take a glance about C# if possible 😂😂😂😂
Dima
Yeah, it's fucking awful That's why you can trust good old C++.
c++ is like a guard for newbies. can’t let them pass into a programming world lol
Dima
unlike js/python
Dima
actually c# is not that bad. combing c++ backend and all tech with c# interop is pretty sexy
Asdew
C# looks awful in my opinion.
NXiss7
unlike js/python
I started with Python then moved onto C fucking ++. Hell yeah! 😎😎😎😄😄😂
Dima
P H P
/baп php
Dima
🌚
NXiss7
> python I will say I don’t know you anymore:)
I don't (can't stand) use it anymore... I usually get thing done faster in C++, I'm pretty familiar with that and written many libs for that...
Yakov
I'm also started with Python :)
NXiss7
You've lost me man... 😅😂
Asdew
I started with Java, went to Python and now to C.
Dima
> microsoft