Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
F

Filipe Marques

@Filipe Marques
About
Posts
6
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C and Macros
    F Filipe Marques

    Hi Leon, thanks for your answer. What you described here is exactly my problem. The problem is that I always program in C++ and the few C programs were really small ones. The way to think is a little different and I always think in an object way. I decided to migrate to C++. The code became cleaned and easy to read. One more time, thanks for your answer and I am sorry to take so long to answer :) Best regards Filipe Marques

    C / C++ / MFC question

  • C and Macros
    F Filipe Marques

    Thank you Stefan, I didn't know about "locality of concern" or "information hiding". In these couple of days I have been review the code and yes, I am passing information that I am not really using in my functions and I am making all of them available to the user, unnecessarily. Right now I am redrawing the code ... again :laugh: Best regards Filipe Marques

    C / C++ / MFC question

  • C and Macros
    F Filipe Marques

    Hi Stefan. Thanks for your answer. It is very smart way to contour the problem. I think I would never figure out a solution like that :) . The reason of so many levels is because the s1 is an identity with a lot of different information and I must have access to them in every function (I thought this was the best way) but I will take a chance in C++. I think in my situation will help me a lot. Best regards Filipe Marques

    C / C++ / MFC question

  • C and Macros
    F Filipe Marques

    Hi Richar, thanks for your answer. Yeah, the code is getting realy hard to maintain and each little change I do, it is a nightmare. :( Best regards Filipe Marques

    C / C++ / MFC question

  • C and Macros
    F Filipe Marques

    Thanks for your answer Jochen. I have been thinking better and maybe I will accept the Richard suggestion because the real situation is something worst

    struct1->struct2->struct3->struct4[struct5->struct6->struct7]

    Not pretty ah?. :laugh: Best regards Filipe Marques

    C / C++ / MFC question

  • C and Macros
    F Filipe Marques

    Hi everyone, Right now, I am creating a project in C and at some point I am accessing, multi times during the source code, to a struct with a lot of nested structs, like this

    struct1->struct2->struct3->struct4->struct5->value1
    struct1->struct2->struct3->struct4->struct6->value2

    What I created was a macro to clear the code:

    #define ACCESS (struct1->struct2->struct3->struct4)

    ACCESS->struct5->value1
    ACCESS->struct6->value2

    My question is: This is a good practice or a very very very bad practice? Best regards, Filipe Marques

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups