No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm trying to strip only path from a c string char *path = "~/folder/sometext.txt" so I would get only "~/folder/" Anyone got a hint on how to achieve this? I was thinking of something similar to std::string find_last_of so I could just indicate the last "/" or "\" in the … |
|
I'm very confused about void pointers and this notation here below. I do understand that when you have a void pointer you eventually cast it to some kind of type int, double. What I don't understand is what is happening here : copySize = *(size_t *)((char *)oldptr - SIZE_T_SIZE); copySize … |
|
Hey everoyne. I'm wondering If it's possible to construct a switch statement which takes in a character and determines weither that character is a number or not, or an alphabetical number. switch(i) /*character*/ { case '0': /*ok it's a number, doesn't have to be zero, any number from 0-9*/ case … |
|
Hi. I'm making a shooting game and since my code was getting a bit messy and big I decided to divide it into couple of classes and files. I'm confused of how to correctly split these files and classes up though. As I imagine it without really knowing if that … |
|
I'm doing a program where I need user to enter the name of a text file. I want him to be able to see the path if he enters pwd. Right now this is very OS related and only works on Mac OS(I guess). So I have done string real; … |