Ben Cottrell

United Kingdom

Age: 33

Jan
14
awarded Good Answer
Jan
14
comment pointer to array c++
@johnbakers yes it is absolutely necessary to specify the length of the array, otherwise you will not have a pointer-to-array, and then the code would not compile unless you used a cast. Pointing-to an array implies that you have knowledge of its length at compile time. The compiler message resulting from omitting the array length in MSVC++ reads error C2440: 'initializing': cannot convert from 'int (*)[2]' to 'int (*)[]'
May
19
comment Pyramid aztec in C++
What have you tried putting in there?
May
8
awarded Informed
Apr
8
awarded Yearling
Apr
8
awarded Yearling
Mar
29
awarded Yearling
Mar
29
awarded Yearling
Jan
24
comment Is there a direct way to concatenate two char arrays (char*)?
Are you aware that std::string has a member function called c_str() which yields a const char* as a pointer-to the first character in your string?
Nov
2
reviewed Approve suggested edit on YouTube iFrame has intermittent load errors
Nov
2
reviewed Approve suggested edit on Assigning a created object to a selected object
Oct
23
revised getting data value from node, pointer confusion
Comments to describe the logical steps
Oct
23
comment getting data value from node, pointer confusion
@TommyK No, I didn't mean that at all - doing that would cause you to delete the second node in your list, and leave a "dangling" pointer (which is a likely cause for a Segfault). The line head = head->next ensures that the first node is safely removed from your list before you delete it.
Oct
23
revised getting data value from node, pointer confusion
added 108 characters in body
Oct
23
answered getting data value from node, pointer confusion
Oct
2
awarded Custodian
Oct
2
reviewed Approve suggested edit on C++ Using Variables in Classes
Sep
3
awarded Civic Duty
Jul
11
awarded Excavator
Jul
11
revised one to one relationship with fluent api
Code formatting to reduce width
1 2 3 4 5