Questions tagged as 'c++'

1
answer

manipulation of any one struct

I have a struct, how do I predefine data in this struct? example define life of struct 100? I've tried dataplyer.vida = 100; struct dataplayer { int vida; int armadura; int arma; int level; };     
asked by 05.01.2019 / 05:10
1
answer

Where is the error? "system is not declared in this scope"

You're supposed to do this link I wrote this link But in the part of the greater of 15 years he does not let me write to read the name ... #include <stdio.h> #include <locale.h> main(){ setlocale(LC_ALL,"portuguese");...
asked by 14.11.2016 / 21:20
1
answer

Find strings within * .txt files in C

I'm a beginner and I'm trying to make a program and C ++ that requires two functions. 1) Search in a * .txt file for a specific string; 2) By some kind of index indicate the position of this string within the file. To try to explain bet...
asked by 20.12.2016 / 02:37
1
answer

Repeat until the correct letter is entered [closed]

Using the switch function, case 'T' : case 'T' : default: How do I do for example the two cases represent a letter each, but if the user chooses a different one then it follows by default that will redo the same question, (ch...
asked by 05.01.2017 / 18:20
1
answer

error expected primary-expression before '' token [closed]

Error on line 21. #ifndef __STRING_H__ #define __STRING_H__ #pragma warning(disable: 4786) #include <string> #include <vector> const int MAX_RESP = 4; typedef std::vector<std::string> vstring; bool isPunc(char c); void c...
asked by 29.05.2016 / 17:59
1
answer

Resolve operation with Set

   Question 1 - Consider the set X = {x ∈ Z: 1 ≤ x ≤ 32}. Implement a program in C that performs the following statements.       Create three integer vectors of size 12: vector0 [12], vector1 [12] and vector2 [12].    Store in the vector0 the...
asked by 24.05.2018 / 23:50
1
answer

http requests using the C language on windows? [closed]

How to make http requests using the C language in windows? No need to post code, just a good reference is enough for me :) But if someone has an example it will be of great help;)     
asked by 28.05.2018 / 23:43
1
answer

Calling a class by the value of a member

I would like to know how I could check if the id of an inherited class equals an x value. Something like: class X { id = 3; }; ... class Y { id = 4; }; I have a variant of any x, how could I check if x is equal to the id value...
asked by 30.07.2015 / 19:01
1
answer

Reading a String [closed]

If I have a String that is: String s = "2123dog"; How can I calculate the first character 2 to transform the next 2 characters into an integer, and 4 to transform the name that is dog? The result would be (12, dog)?     
asked by 30.07.2018 / 02:24
1
answer

How to select matrix positions / random draw? [closed]

Good morning! I need to make a random draw from the array elements to find out if there is a boat (boat = 1). Just as at the end of 10 attempts I need to print with (x) the bombed positions successfully, shots on water (-), water (A), ships (N)....
asked by 04.10.2015 / 19:37