Questions tagged as 'c++'

1
answer

Computational Geometry - How to check if two lines intersect only at the anchor?

Well, I need to make a program in C ++ that gets a A (x, 0) point a point B (x, 0) this point A and B they are on the x-axis, always with y = 0. After receiving the A point and the B point, I have to receive a C (x, y) D (x, y...
asked by 06.08.2018 / 17:33
4
answers

My program made in C ++ is in infinite loop, how to correct?

My program jumps right to the end, Neither enters to read. Follow the code below: #include <iostream> int main(void) { int i= 0; string nome; for(i=0;i>=10;++i) { cin>>nome; cout<<nome<<endl; } } I...
asked by 11.08.2018 / 21:16
1
answer

Operator overload in C ++

I have the program below: #include <iostream> #include <sstream> namespace std { int bin(int n) { if(n!=0)bin(n/2); if(n!=0)std::cout<<n%2; } } int main() { int n; std::istringstream("2a") >> std...
asked by 22.02.2017 / 21:22
2
answers

How to isolate higher order bits and lower order bits in C / C ++?

I need to create two functions One receives an integer value and returns another containing only the 8 lowest-order bits of the original value, with the other bits set to zero. The other receives an integer value and returns another cont...
asked by 11.01.2018 / 15:47
1
answer

Create classes and functions in c ++ [closed]

Can anyone give an example of how to create main, o .h and .cpp in c ++? And also bind them all. For example having a function that receives an input a value a, have another class that receives input a b and a class apart to do the sum and retur...
asked by 13.11.2018 / 19:13
1
answer

TCP / IP Protocol on Linux and Windows

Can the structure of the TCP / IP protocol vary from Windows to Linux or even from language to language? the knowledge gained on TCP / IP in the C ++ language can also be taken into account in Python? Hugs     
asked by 05.12.2018 / 09:02
3
answers

Error trying to make operator overload with dates [closed]

I'm trying to overload operators for dates, but if I use a double overhead it gives error. What I actually want to do is that if the user uses a separator setting a format it accepts and if the user does not use it get the default format defi...
asked by 07.07.2017 / 23:56
2
answers

Create an algorithm to identify days of weeks in c ++ [closed]

How to create an algorithm to identify day of the week (numbered 1 to 7) and weekday, weekend, or an invalid day?     
asked by 03.03.2017 / 08:26
1
answer

SWITCH error - Sequential Search and binary search

#include <stdlib.h> #include <stdio.h> #include <conio.h> #include <iostream> #include <fstream> #include "pessoa.h" using namespace std; int main() { //CADASTRA PESSOAS ofstream fout("pessoas.dat"); Pes...
asked by 07.05.2015 / 03:23
1
answer

Limit a specific value to a string

I need to limit to a specific value that would be 511 char command[512]; I tried with char command[512]; scanf("%511s",command); if (StrToInt(command))>511) printf("FIX ATK"); and this too char command[512]; scanf("%511s", comma...
asked by 12.12.2017 / 14:59