Leonardo
the fscanf what value returns?
Leonardo
the numbers of elements read in a file?
\Device\NUL
Leonardo
for example this code https://dpaste.org/8WBAp in the while fscanf(...)>0 means: read the file unless you reach the EOF?
Leonardo
what does it means fscanf(...)>0?
\Device\NUL
Syed
Can anyone send me any pdf of C++ from basics?
Where problems with explanations are given...
klimi
...
can anyone tell me how to become master in c programming language
Anonymous
Anonymous
Leonardo
why gets is dangerous?
\Device\NUL
Anonymous
why gets is dangerous?
cuz gets read all from STDIN and just paste it into ur buffer, without length checking and it can be overflowed
\Device\NUL
Me use scanf with max field width
\Device\NUL
scanf to input string without limit is same with gets
Leonardo
Anonymous
Hi
Doreece
Hi .Would you please help me solve this out ?
I should write a code which gets from me (n) as the number of numbers I should give to the code after that .then i should calculate the sum of every 2 numbers to find the couple with sum which I gave as the last number before .
My code calculates only the first number with others and doesn’t check the 2nd with others and so on.
Rajeev
multimap<int,int> m;
m.insert(make_pair(10,20));
//m[10] = 20; this isn't working why?
Today while coding in C++ i came up with an unknown error. I used this method on maps but it it's working on multimap. Anyone know why?
no match for 'operator[ ]' (operand types are 'std::multimap<int,int>' and 'int') m[cs] = i;
alessandro
alessandro
send slice of code
alessandro
wait, you want assign 20 in box, but you just have created 1 box
alessandro
std::map<int, int> m;
m.insert(std::make_pair(10, 20));
m[0] = 1;
Rajeev
Rajeev
But this isn't working in multiple map .
alessandro
alessandro
it hasn't a key does you could access your data
Rajeev
Oh got you. Because of multiple keys
alessandro
Rajeev
Just learnt something new. Thanks
alessandro
wait
alessandro
you could do something but it's not much clever
alessandro
create a iterator and then use function advance(it, position)
alessandro
std::cout « m->first « m->second
Joe
Rajeev
Another problem of multimaps
multimap<int,int> m;
auto start = m.begin();
cout<<*(start).first; // doesn't work
cout<<start->first; // why?
Deepak
Hello everyone,
I need a code on scientific visualization can anyone help me regarding this
...
some of them write c program like this:
#include<stdio.h>
#include<conio.h>
void main()
{clrscr();
getch();
}
and some people write like this:
#include<stdio.h>
int main ()
{
return 0;
}
which is better to write
...
Zahra
Hi, does anyone know how to write a code that calculates the derivative of polynomial functions?
Anonymous
mingw32-make: *** [launch ] Error -1073741819
what is this problem ?? how i can fix it ??
Anonymous
Anonymous
Hii everyone 😃
I actually learned the basics of c++,
Can someone plese give me an advice on what to do next ? 🙏
Like how to apply it to become advanced
Thanks ! 😊
Anonymous
I'm trying to use default arguments for some parameters without rearranging the parameters.
This is what I want to achieve but its not working.
void func( int a =1, int b = 2, int c = 3)
{
}
Int main()
{
func(5 , , 8);
}
I only want to use the default argument in the middle or only the last default argument or both 2nd and last default argument.
So I want to pass value only to the first parameter.
Anonymous
I don't want to rearrange the parameters because I may sometimes use the first as default and pass the second and third
Pavel
Pavel
Anonymous
Anonymous
Rakesh
Evaluate the following expressions:
1) 22 +3<6 && !5 || 22 = =7 && 22-2> +5
How to solve further...
0&&!5||0
Michel
Is there any way of making an enumeration to hold a value? I want to have, for instance:
enum Token{
PLUS,
MINUS,
NUMBER
}
In such a way that I can pass a value if the Token is NUMBER.
Michel
Anonymous
devengine
Anonymous
can
Mr
Leonardo
guys ive got a question...i have to take some data from a csv file...i have to use the fscanf but idk how to do that...the first line of the file are the names of the columns and the others 1599 are the data that i have to read...with the fscanf i want to store the data from the file in an array of float and when i go to read this array i see some weird numbers , also i idk how to discard the first line cause fscanf read unless it reaches a space
Anonymous
klimi
I think you will have to send your code, skipping first line just means you just read the line and then start to parse (if you want to completely ignore it)
ricks
Hi I've been playing around with c++ ,What framework are you guys using with c++ nowadays?
klimi
klimi
Ludovic 'Archivist'
We all have those little comfort function we make because the std library lacks them
Ludovic 'Archivist'
like, I have this repeat function that I use all the time for writing tests or just code that repeats:
template <typename F>
void repeat(size_t n, F f) {
while (n--) f();
}
And in a library it goes just to avoid the mental hurdle of writing it again
Trí
#include<stdio.h>
int main(){
float a[ ] = { 13.24, 1.5, 1.5, 5.4, 3.5 } ;
float *j ;
j = a ;
j = j + 4 ;
printf ( "\n%d %d %d", j, *j, a[4] ) ;
return 1;
}