Anonymous
sory if my code sux ive only been doing this a few days
Anonymous
why?
Anonymous
whats wrong with this?
Anonymous
so use std::string snd std::cout instead?
Anonymous
makes sense
Eu
I never cared about size but I heard templates use a lot of space
each template instance will create the code same code for different template parameters so yes, they usually increase output binary size
Eu
you should not use "using std" in headers, because they will propagate to all .c files in what you include it,
ENOENT
makes sense, I hear that's why boost is so giant
Eu
but some namespaces are really long, so you can use using in some context if you don't want to be reading ns1::ns2...::nsN in all your code. So for your test is OK, at least in my opinion :)
Anonymous
makes sense, I hear that's why boost is so giant
i keep seeing people saying stay away from boost, ideally id like to write my own libraries for my programs
Eu
then you will spend all your time writing the libraries for your program but you will not have time to write your program :)
Eu
use all you need; if it does not fit you, or you need to do in other way, replace it. You will adquire good encapsulating habits with practice
Anonymous
then you will spend all your time writing the libraries for your program but you will not have time to write your program :)
maybe later ill have to use libraries that are already made but rn im not dong anything serious with c/c++, i will be trying to use it in a hobby os later, which is my main reason for trying to get familiar with c/c++ which then i have -nostdlib
Anonymous
&rn i think im supposed to use c not c++ at first but im really not that far i need to rewrite my stage1 and stage2 since i lost all my data last month
Eu
is there an equivalent of the python "from x import y" or "import x as y", btw?
you have to import all header, but you can use this: typedef std::string mystring; or, in C++11: using mystring = std::string;
Eu
in fact, that is a good alternative if you don't want to pollute your namespace with all std/whatever namespace
Eu
you're welcome :)
ENOENT
I should probably actually go learn C++
ENOENT
I mostly learned by reading
Eu
good start point then
ENOENT
ye
ENOENT
it's just so fast to write
Eu
agree, C/C++ is a pain in comparison
ENOENT
that's why I learned C++, it's very easy to extend python with it
ENOENT
it's also how I learned it
Anonymous
is using std::string; using std::cout; acceptable?
ENOENT
I learned C before actually but I never really used it
Anonymous
instead of using namespace std;
Anonymous
well im at work be back in 8 hours
Eu
that's another way to proceed, if you use a library with lib::string, std::string will be the used
Eu
that is even more close to python from ns import module
Anonymous
many
agree, C/C++ is a pain in comparison
Create a function yourself on string comparison
Eu
but... then you have to write more than python
Eu
that answer was comparing C/C++ vs python in "speed making a program in that language"
many
Oh I mix up with string comparison LOL
many
Python does have a lot of useful libraries
many
But it's fun to play with memory
many
I find C/C++ are more fun to play with
Anonymous
correctmaninwrongplace
correctmaninwrongplace
People that works with limited system loves that
Anonymous
I need some assistance
Anonymous
Someone to write a program that accepts marks from 20 students and compute the average ,use function ,output students name and marks and the average for the class
Anonymous
Using C language
Anonymous
You could be that person
Anonymous
Am not that good in C
Abde
Am not that good in C
It's a really basic program
Anonymous
Anonymous
This is an opportunity for you to learn to be good enough at C to write that. We can help you with the resources and questions. It won't take too long to learn that, don't worry.
Abde
Or even the basics of programing?
Anonymous
Abde
Well, as it name says
Abde
C++ is c "incremented"
Edurolp
How about searching tutorials by your self?
Abde
You should not have problems to resolve that problem
Anonymous
Ok
Anonymous
Send me tutorials then...😭😭😭😭
https://www.tutorialspoint.com/cprogramming/ http://www.cprogramming.com/tutorial/c-tutorial.html http://www.learn-c.org/
Anonymous
You could quite easily just write it the way you'd do it with c++ and then you shouldn't be too far off anyway considering the amount of code you need for your solution, just looking at the minor differences for things.
Anonymous
Which would be a helpful task for you to understand simple differences between the languages
Anonymous
I'll try to help you if you need it but I won't do your homework
I'm agree with you. You don't do your homework @cosssie
Secu
Hey! How I can convert a char array to int? I hace something like this:
Secu
I have a txt with this: '100 JK9' And I put every number (only number before " ") like this: Vel[0]="1"; Vel[1]="0"; Vel[2]="0";
Secu
And I want get that every Vel[num] pass to an int and finally looklike this: Int speed: 100;
Edurolp
I would search how to split a string in C
Secu
I used atoi but failed
Secu
C++
Secu
Sorry
Edurolp
And after that, use atoi at the splited string
Anonymous
Atoi is C standard function
Secu
std::stoi sorry
Secu
Maybe thia photo explain better than me