Anonymous
and the reference points to the same object
Anonymous
but with primitives, it doesn't work
Anonymous
the example made in the stack overflow thread doesn't work because it makes the copied reference point to the new object
Anonymous
but if you modify the object the reference was pointing to without changing what it points to within the method, it works
Anonymous
Anonymous
Help me to solve this
Álvaro
XDDDDDDDDDD IN C++?
Anonymous
This is physics
Anonymous
Lmao
Anonymous
Guys who is good at theory of languages?
Anonymous
Automata and stuff like that..
Anonymous
I think its gonna annoy u guys ..here is it
Anonymous
Anonymous
I d like to minimze this NFA
Anonymous
I went to various websites .and read about minimization
Anonymous
Except this automaton is burning my brain xD.anywat dont answer me if u are busy and thanks so much
Álvaro
NFA? n... finite automata
Anonymous
Michael thats what im dealing with everday xD i just had the course yesterday yet i forgot..im getting old whn im only 20
darshpreets
getiing error in data
darshpreets
anyone help
Liam
Could you please provide a minimal working example?
* short enough, without inessential codes;
* compilable and executable;
* being able to reproduce the problem you have met.
darshpreets
darshpreets
#include <iostream>
#include <string>
using namespace std;
int main() {
string name, street, state;
int zip;
char more_data = 'Y';
do {
cout<<"\n \nName..........";
getline(cin,name);
cout<<"Street........";
getline(cin,street);
cout<<"State.........";
getline(cin,state);
cout<<"Zip Code......";
cin>>zip;
cout<<"\n \nEnter another Record? (Y/N) \t";
cin>>more_data;
}
while((more_data == 'y') ||(more_data == 'Y') );
}
darshpreets
darshpreets
Name..........das gupta
Street........sdagv 144
State.........54
Zip Code......144
Enter another Record? (Y/N) y
Name..........Street........
State.........
Zip Code......
darshpreets
why on next iteration I'm getting whose Name.......Street without taking input I'm not able to figure it out.
darshpreets
Liam
can you look again
I was busy, sorry for the late response.
When you type y, and press enter, std::cin eats y and puts it in more_data, and enter is left in the input stream.
For the next loop of your do ... while loop, std::getline() eats the last enter, and dumps an empty string into name.
This is why you get Name..........Street........ for the second loop.
darshpreets
ok go it
Liam
For Linux, press Ctrl + D after your Y; and for Windows, press Ctrl + Z. You'll get what you want.
darshpreets
so what I need to change for to prevent that enter to eat second time d
darshpreets
Liam
FYI, int for ZIP number is not enough. In some country, ZIP could contain letters. E.g. UK.
Liam
You may want to have a look at:
https://postal-code.co.uk/postcode/London
darshpreets
Liam
darshpreets
Thanks a lot, I hope it will fix my code 😊
Liam
#include <limits>
...
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
For example.
darshpreets
Thanks a lot it worked.
Liam
template<> // full specialization for std::hash
struct std::hash<Type> {
typedef Type argument_type;
typedef size_t result_type;
result_type operator()(const argument_type& t) const noexcept {
return std::hash<int>{}(t.key);
}
};
triggers a bug of GCC (under 4.8.0), please note and bypass it (by surrouding with namspace std).
: )
Sukesh
Hi<
I am trying to use wiringPi
http://wiringpi.com/download-and-install/
In a c++ program
I have written the c++ code as follows.
#include <wiringPi.h>
int main (void)
{
wiringPiSetup () ;
pinMode (0, OUTPUT) ;
for (;;)
{
digitalWrite (0, HIGH) ; delay (500) ;
digitalWrite (0, LOW) ; delay (500) ;
}
return 0 ;
}
But when i compile using the following statement
g++ -Wall -o test test.cpp -lwiringPi
I am getting the following error.
/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libwiringPi.so: undefined reference to `crypt'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libwiringPi.so: undefined reference to `pthread_join'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libwiringPi.so: undefined reference to `pthread_create'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libwiringPi.so: undefined reference to `shm_open'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libwiringPi.so: undefined reference to `pthread_cancel'
Any one knows Why?
Harry
Sukesh
No. Trying. Thanks
Anonymous
hello goodmorning?
Liam
Harry
Sukesh
g++ -Wall -o test test.cpp -lwiringPi -lpthread -lrt
This works. 3 errors fixed. Only one exist now
//usr/local/lib/libwiringPi.so: undefined reference to `crypt'
Sukesh
Do we need to install anything for crypt?
Harry
Sukesh
Ok. Thanks.
Temur
Hi :D
Liam
Anonymous
i am striving to learn this c++...can anyone find the error in this program
the program executs but I am not getting the correct output
Anonymous
Liam
In your codes, you made an assumption that c is initializated to 0. However, this assumption is not always correct.
It would be better for you to explicitly initialize your variables before use. In your case, say int c = 0;.
Liam
BTW, this is C, not C++.
Anonymous
Oh..thanks a lot....this means a lot to me
Liam
https://www.google.com/doodles/celebrating-50-years-of-kids-coding
A little programming game from Google, a good toy for kids.
Sukesh
Sukesh
I am working with an OpenWrt Project.
I am using few packages for tool chain build and there is a make file for each package.
I wanted to know that is there any way we can install that package in Linux development machine(Ubuntu) by using make command option?
I am sharing a sample makefile also
Sukesh
If anyone having better idea, Please help?
Isc
Tell me what's declval and when it's used for
Isc
Please master
Isc
oh wow thanks
Isc
Hyml is really nice for wob poges
Liam
Programming languages are just tools. Just like the difference between knife and brush. You use knife to cut, and you use brush to clean. Every tool has its field to apply. In this field, the power of the tool is maxed, however in other fields, it will fail to do the job. Hence, there is no best and strongest language, there are just appropriate languages for a specific problem or project.
David
First learn english
David
I'm not able to understand you.
Liam
Good to know.
However, if you want to communicate with each other here, you have to practice your English first.
Isc
Liam
Stanislav
Liam
Liam
Berkus
Stanislav
batman file
Liam
lol