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
F

focusdoit

@focusdoit
About
Posts
14
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • reference question
    F focusdoit

    I found, a statement, int &a = 1; the statement can be built in QT Creator, mingw_64. while on Programiz: Learn to Code for Free[^] Got,

    gcc /tmp/BlXEG8NqhU.c -lm
    /tmp/BlXEG8NqhU.c: In function 'main':
    /tmp/BlXEG8NqhU.c:6:15: error: expected identifier or '(' before '&' token
    6 | const int &a = 2;

    so the int &a = 1; is that right? a is a bias name of "1" in rodata?

    C / C++ / MFC question com help

  • conflicting types for 'uint32_t' issue
    F focusdoit

    Thanks, it's a big project, i found the issue,

    new 1 (33 hits)
    XXX_Global.h: error: conflicting types for 'uint32_t'
    Line 17: typedef unsigned int uint32_t;
    gcc-6.3-arm32-eabi\arm-none-eabi\include\sys\_stdint.h:48:20: note: previous declaration of 'uint32_t' was here
    Line 24: typedef __uint32_t uint32_t ;

    there are 2 tyepdef uint32_t

    C / C++ / MFC help workspace

  • conflicting types for 'uint32_t' issue
    F focusdoit

    I got the conflicting types error when I built the code, while, i searched the workspace, i only found one tyepdef, Shrink ▲ Copy Code typedef unsigned int uint32_t; in Eclipse, search:typedef*uint32_t i can't find where there is another typedef * uint32_t. Please help to give some ideas.

    C / C++ / MFC help workspace

  • conflicting types for 'uint32_t' issue
    F focusdoit

    I got the conflicting types error when I built the code, while, i searched the workspace, i only found one tyepdef,

    typedef unsigned int uint32_t;

    in Eclipse, search:typedef*uint32_t i can't find where there is another typedef * uint32_t. Please help to give some ideas.

    ATL / WTL / STL help workspace

  • #define statement reported error message
    F focusdoit

    Hi, I found the following define statement, compiler reported error, not very understand, need some helps. :)

    /*test comment*/
    #define SM_INT(dptr, off) \
    /*test comment*/
    (unsigned int)( (((unsigned int)(dptr[(off)]) & (unsigned int)0x000000FFU) << 8U) \
    /*test comment*/
    | (((unsigned int)(dptr[(off)+1U]) & (unsigned int)0x000000FFU)) )

    Error is: compiler requires a type specifier for all decalarations; user of undeclared identifier "dptr"

    C / C++ / MFC help

  • C++ Vector object question
    F focusdoit

    Hi, I read a block of code, like:

    class Graph
    {
    public:
    int V; // number of vertices
    vector *adj; //adjacency list

    Graph(int V);
    void addEdge(int x, int y);
    bool isRoute(int x, int y);
    

    };

    // Constructor
    Graph::Graph(int V)
    {
    this->V = V;
    this->adj = new vector[V];
    }

    // add a directed edge from x to y
    void Graph::addEdge(int x, int y) {
    adj[x].push_back(y);
    }

    int main() {

    Graph g(6);
    g.addEdge(5, 2);
    g.addEdge(5, 0);
    g.addEdge(4, 0);
    g.addEdge(4, 1);
    g.addEdge(2, 3);
    g.addEdge(3, 1);
    

    }

    I wonder the adj is a pointer that points to a Vector object, and a vector object I think it's like an one-dimensional array, but the addEdge() operation, adj[x].push_back(y),it make another array[x,y]. in Main(), the structure of the vector object, seems like: [5,2,0] [4,0,1] [2,3] [3,1] Then this is not an one-dimensional array.so this is a Vector object, or 4 vector objects? Thanks

    C / C++ / MFC data-structures question c++ graphics

  • Condition variable question
    F focusdoit

    Sure, the code is embedded software code, no OS, so, do you think there is a better way to implement the condition variable?

    C / C++ / MFC question help

  • Condition variable question
    F focusdoit

    So use While(cx != True) ; similar code could resolve it?

    C / C++ / MFC question help

  • Condition variable question
    F focusdoit

    Why the above code could be deadlock. thanks

    C / C++ / MFC question help

  • Condition variable question
    F focusdoit

    can you explain a little more ? thanks

    C / C++ / MFC question help

  • const char [] and char[] difference question
    F focusdoit

    Hi, I wrote a small c program on a microcontroller, 32bit. I met a weird problem. I wrote code like:

    const char strtest[] = "Test123\r\n"; //Global
    UART_print(strtest); //in a loop

    the output is fine, I can see the output on Teraterm(RS232 interface tool), like: Test123 Test123 .. But when I try code:

    char str123[] = "Test123\r\n"; //Global
    UART_print(strtest); //in a loop

    The output is only the first element: TTTTTTTT Any hint is appreciated.

    C / C++ / MFC hardware help question

  • how to use memset to fill a char array with space key?
    F focusdoit

    in fact, it's snprintf() reason. snprintf seems fill out the gap in a string with '\0'. the code like:

    memset (msgArray, ' ', 100);
    snprintf (msgArray, 2, "%d", 1);
    snprintf (messageArray+10, 33, "%s", "main");

    I assume the string should output like: 1 main but debugged it. it is : 1,\0, ' ', ' ', .. main, \0, ..

    C / C++ / MFC data-structures tutorial question

  • how to use memset to fill a char array with space key?
    F focusdoit

    Thanks, ' ' and 32 work. in fact, it's snprintf() reason. snprintf seems fill out the gap in a string with '\0'.

    C / C++ / MFC data-structures tutorial question

  • how to use memset to fill a char array with space key?
    F focusdoit

    Hi, I want to fill out a char array with space. like:

    memset(msgArray, '*', 100);

    but '*' should be a Space key.

    C / C++ / MFC data-structures tutorial 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