Problem Consider the following C#/C interop scenario: public static extern IntPtr lua_newstate(); public static extern void lua_close(IntPtr state); IntPtr luaState […]
Tag: pointers
Enumerating an alphabet
Problem Since train rides can be long and boring, I’ve decided to make use of that time and fiddle around […]
Writing the function strend()
Problem Due to being unable to ask a C programming language expert or advanced user in person, I’m posting this […]
Replace part of the string with n size with string of m size
Problem I wanted to understand memory and pointers better before I endeavour into file path manipulations for larger project. This […]
Converting Integer to dynamically allocated Char array, digit by digit using pointers
Problem Problem: Write a function to convert Integer to String, using only pointers, without array indexes, string must be dynamically […]
Wrapping the iOS triple buffering procedure in a generic swift class
Problem In the Metal sample code and best practices guides it is advised to use a triple buffering technique to […]
Traversing an array with a pointer to the array
Problem I was thinking about how to traverse an array without an int iterator, and I’m curious if my answer […]
Printing the contents of a string array using pointers
Problem I’m currently studying C and I’m trying to just print the contents of a string array. I’m using pNames […]
2D matrix – splitting the matrix in two parts with equal number of elements
Problem The elements in the matrix are either ‘M’, ‘G’, ‘P’ or ‘.’ and the algorith must write out all […]
Smart pointer class implementation
Problem I decided to implement a simple smart pointer class in C++ name my_pointer. Please review this code. #include <iostream> […]