Hey, I am trying to convert NSString to a C string using cStringUsingEncoding but I have a memory leak. My understanding is that cStringUsingEncoding returns a pointer to a character array that is only guaranteed to exist for the duration of the NSString object. As such you should copy its contents to another string. Here's where my prob...
I'm writing a simple text-template language for a web application I'm writing (think google's ctemplate). When finished, it'll feature only a small number of possible actions, simple stuff like "evaluate and execute", "evaluate and print", "evaluate and escape html", "comment". I was thinking of hand writing the whole parser from scratch...
What is the most efficient way of getting current time/date/day/year in C language? As I have to execute this many times, I need a real efficient way.
I am on freeBSD.
thanks in advance.
...
Hello,
Where can i find example: popup menu with sub-menus made with GtkUiManager.
Thank you
...
I want to know how the "isupper" macro is defined in C/C++. Could you please provide me the same or point me to available resources. I tried looking at ctype.h but couldnt figure it out.
...
So it's been a while since I've used straight C. And I'm on a project where I'm working on an API in C++. Most of these methods are just C anyway, and all of the return values are C structures. Except one. One method I need to return a vector<string>. Now here's my question. Is C++ methods/libraries/whatever callable from C? I ask becaus...
Hi,
I'm trying to compile a little project that includes windows.h using the clang compiler. Unfortunately, clang produces some errors I'm not able to resolve. What's causing these errors? Does clang not support all required features, am I missing something?
In file included from C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include/w...
How to prevent further signal handlers to be called from the first signal handler callback in GSignal?
For example, i register three functions - func1, func2 and func3 for the same signal "mysignal". If func1 is called first, how can i prevent func2 and func3 to be called from func1?
This should not be made permanent. It should be runt...
Please see the code:
int main(int argc,LPTSTR argv[])
{
HANDLE hinFile;
BOOL check;
PLARGE_INTEGER file_size;
hinFile=CreateFile(argv[1],GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
if(hinFile==INVALID_HANDLE_VALUE)
{printf("INVALID_HANDLE_VALUE\nFile Does Not Exist");exit(0);}
else{
check=GetFileSize...
I have an Objective-C protocol:
typedef enum {
ViewStateNone
} ViewState;
@protocol ViewStateable
- (void)initViewState:(ViewState)viewState;
- (void)setViewState:(ViewState)viewState;
@end
I'm using this protocol in the following class:
#import "ViewStateable.h"
typedef enum {
ViewStateNone,
ViewStateSummary,
Vie...
Are there any C/C++ alternatives to Selenium RC or WWW::Mechanize/Python Mechanize?
I guess an option would be to embed Firefox, but I just require something that will allow me to automate testing of websites while honoring state.
...
i am supposed to code a bubble sort program in embedded C using keil uVision. I havnt yt understood what is it that is actually required. I have been told to use registers and/or ports in it. if anyone can understand what exactly has to be done pls help me out...
...
for example if it is given to make all the choices between 1 to 5 and the answer goes like this..
1,2,3,4,5,
1-2,1-3,1-4,1-5,2-3,2-4,2-5,3-4,3-5,4-5,
1-2-3,1-2-4,1-2-5,1-3-4,
.....,
1-2-3-4-5.
can anyone suggest a fast algorithm?
...
I am preparing some custom performance tests against a legacy application that outputs nonstandard HTML (missing tags, duplicate quotes, missing quotes, the works) that can't be changed right now for all the usual reasons.
I am looking for a library similar to BeautifulSoup or "HTML Agility Pack" that can be called from C or Java on a U...
Hi all. I'm making a small console-based rpg, to brush up on my programming skills.
I am using structures to store character data. Things like their HP, Strength, perhaps Inventory down the road. One of the key things I need to be able to do is load and save characters. Which means reading and saving structures.
Right now I'm just savi...
Is it possible to send a Growl message in a C program?
...
how to learn c basic easily and quickly?
...
I have a bunch of strings that look like:
'Hello1-FOO', 'Aello2-FOO', 'Bye1-BAR', 'Bye3-BAR', 'Hello22-FOO', 'Bye4-BAR', 'Welcome-BAR' ...
All of them are stored on a struct.
struct str {
char *strings;
}
...
struct str **t_str;
size_t j;
t_str = malloc(sizeof *t_str * 20);
for (j = 0; j < 20; j++)
t_str[j] = malloc(sizeof *t...
Possible Duplicates:
Previous power of 2
Getting the Leftmost Bit
What I want is, suppose there is a number 5 i.e. 101. My answer should be 100. For 9 i.e. 1001, the answer should be 1000
...
I am trying to do something a little weird here. I need to start a process, logcat, from a deamon that will run in the background and print to the terminal without taking control of stdin. It is for logging so ideally logcat will print log messages while still allowing the user to input standard commands and initialize programs from th...