Search:

Type: Posts; User: thinkabout

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    788

    Work in progress... using namespace std;...

    Work in progress...




    using namespace std;


    bool defmundo(int size);
    bool defen(int energia);
  2. Replies
    4
    Views
    788

    I want to treat the sentence now, i need to...

    I want to treat the sentence now, i need to extract the next values...

    Example: defmundo 5 2 hard (int int string)
    Example: defxpto hard 2 ( string int)
    Example: defasta hada ( string)



    ...
  3. Replies
    4
    Views
    788

    Parsing commands , istringstream

    Hi,


    I got this coding working but i want to improve it.


    I want to make sure that the frist word i read is a string without numbers.


    Then i want to make sure the second / third word...
  4. Replies
    6
    Views
    763

    I wish the work of that picture was mine. I...

    I wish the work of that picture was mine.

    I donīt have a clue how i should do the board and put colors on my numbers.
  5. Replies
    6
    Views
    763

    Map::Map(int size) { if (size < 10) {...

    Map::Map(int size) {

    if (size < 10) {
    cout << "size to small, need to be at least 10x10" << endl;
    return;
    //TODO output to console
    }
    cout << "size is ok, going to create it" <<...
  6. Replies
    6
    Views
    763

    Print vector of vector

    Hi everyone,

    I am trying to do a map so i can build a game.

    My ideia was to use a vector of vector.

    I want to make a function to print the map but i donīt know how, i am just able to print...
  7. Palindrome - Press enter to continue...

    Hi,

    The part of the Palindrome is working but i want to my program to print "Press ENTER to continue" in the end of each cycle.

    It is working but i donīt think that is the best way.



    //...
  8. Thanks you both for your answers I found this...

    Thanks you both for your answers

    I found this video that i find useful too.

    YouTube
  9. Parameters of the type pointers vs Parameters of the type reference

    Hi, can anyone explain me when should i use pointers and when i should use reference ?



    void exchange(int * pa, int * pb) {
    int temp = *pa;
    *pa = *pb;
    *pb = temp;
    cout <<...
  10. Replies
    2
    Views
    651

    Recommendations youtube channel ?

    Hi,

    I am going to start to give C++ at university.

    Anyone recommend a good youtube channel for that ?
  11. I got two more functions but i am a little lost...

    I got two more functions but i am a little lost where i should use free function.

    Function 1 - Take care of the first client on the list.



    node * see_patient(node * list) {


    node *...
  12. Implementing a medical office. – Linked List

    So far i got new patient and show_queue (working).

    I got a little doubt

    When i make malloc should i put the patient i just create to NULL or that donīt matter ?



    // 1š Get Memory from...
  13. Finally working... Thanks a million. Still...

    Finally working... Thanks a million.

    Still going to need to read about strtol when i got some time.

    I still didn't yet grasp the concept of it the endptr parameter.

    strtol - C++ Reference.
  14. It was on the first post, but yeah the thread is...

    It was on the first post, but yeah the thread is already a little old and long, so easily miss.

    Text File:
    DIM: 4
    Linha0: 12 4 60 60
    Linha1: 3 7 3 5
    Linha2: -56 31 31 12
    Linha3: 34 -33 2 4
  15. Working but what a mess... while...

    Working but what a mess...



    while (fgets(buffer, sizeof (buffer), pFile)) {
    char *p = buffer;

    while (*p) {
    if (isdigit(*p) && (*(p + 1)) !=...
  16. Maybe i am missing something i donīt full...

    Maybe i am missing something i donīt full understand that function.

    But if my text file is

    DIM: 1
    12 4 60 60

    Works nice but if it have a string before the numbers does not work correctly....
  17. I am try to transform the program into a generic...

    I am try to transform the program into a generic one, so the matrix could be DIM 2 or DIM 10 for example.

    But i am not see what function should i use.

    I was trying with sscanf but with start...
  18. I see, i dinīt know how to pass the strings, and...

    I see, i dinīt know how to pass the strings, and no one teach me about size_t.

    I know i can use int bufsize, but i think the correct way is to use size_t (for sure a positive value).

    Why size_t...
  19. Yes i was messing with || and && for (int j...

    Yes i was messing with || and &&


    for (int j = 0; j < KEY_SIZE || flag == 0; j++)


    it works
  20. Break from a for loop with a flag. - Game get at least 3 numbers from 6

    I donīt understand why my program fail, when i try to jump out of a loop using a flag.



    int flag = 0;


    for (int i = 0; i < KEY_SIZE; i++) {
    for (int j = 0; j <...
  21. Now i got other problem if the user forget to...

    Now i got other problem if the user forget to press enter on the last line, it counts 3 lines and not 4.




    int count_lines(FILE * pFile, int nrlines_of_the_file) {

    char buffer[SIZE];
    ...
  22. #include #include #define...

    #include <stdio.h>
    #include <stdlib.h>
    #define SIZE 100

    int count_lines(FILE * pFile, int nrlines_of_the_file);

    int main(int argc, char** argv) {


    FILE * pFile;
  23. // rename - 0 on sucess , -1 on error. if...

    // rename - 0 on sucess , -1 on error.
    if (rename(argv[1], "temp.txt") == -1)
    return -1;


    if (rename(argv[2], argv[1]) == -1)
    return -1;


    if (rename("temp.txt",...
  24. if (argc != 3) { printf("\n- Invalid...

    if (argc != 3) {
    printf("\n- Invalid Sintax: %s Origin(file) Destination(file)\n- Ex: %s CodeA.txt CodeB.Txt\n\n", argv[0], argv[0]);
    return -1;
    }


    rename(argv[1],...
  25. I am study for a exam and i failed on little...

    I am study for a exam and i failed on little things so i am posting a lot of that ones.

    I think that if you want to "build a house" you should get good bricks and sometimes even the things are...
Results 1 to 25 of 63
Page 1 of 3 1 2 3