ItIsStrings is a local variable that goes out of scope as soon as MyFunction returns. You should either pass MyFunction a pointer to an array of characters or declare ItIsString as static.
Type: Posts; User: caduardo21
ItIsStrings is a local variable that goes out of scope as soon as MyFunction returns. You should either pass MyFunction a pointer to an array of characters or declare ItIsString as static.
The directory I tried to delete was empty but remove still did not work.
It does work on Linux and Unix-like systems because everything is considered a file on such machines. Windows makes a distinction between files and directories so I guess that is why it didn't work...
In ANSI C, does the remove funcion also work with directories? I'm having this ongoing discussion on this matter at another board where I was told it does but when I tried it it didn't work and I...
Try this:
scanf("%c%*c",&choice);
The C Programming Language 2nd Edition is a great book. Go ahead and continue reading it. Just make sure you explicit declare the main function returning an int and write "return 0;" before its...
Read a line from the file into a character buffer and use the strchr function from string.h to get a pointer to that tab.
char line[MAXLINE];
/* read a line from the file into line */
char *p...
The reason is that EOF does not fit in a char variable. How would we distinguish a real character from end-of-file if it did?
int
get_num_lines(FILE *streamp)
{
int num_lines = 0;
char ch, prev = NEWLINE;
while((ch = fgetc(streamp)) != EOF)
{
if(ch == NEWLINE)
{
#include <stdio.h>
#include <stdlib.h>
struct node {
void *data;
struct node *next;
};
struct node *rootp = NULL;
Try subtracting '0' from all the values in printf().
a - '0', b - '0', and so on...
What version of the book are you refering to? I opened my The C Programming Language 2nd Edition book on page 54 and there's no binary search implementation on that page...
http://www.cppreference.com/stdmem/malloc.html
This should help you.
#include <stdio.h>
int main(void)
{
char v[] = "blablabla";
v[0] = 'b';
return 0;
}
I am trying to declare an array of structures of type INPUT like this and I get the following errors:
#include <windows.h>
INPUT a[2];
error C2065: 'INPUT' : undeclared identifier
error...
I tried this without success
#include <stdio.h>
#include <windows.h>
int main(void)
{
ShellExecute(NULL, "open", "www.google.com", NULL, NULL, SW_MAXIMIZE);
HWND IEHwnd =...
Cool-August, that was exactly what I used :D
I know about the Spy++ tool that comes with Visual C++ :)
Speaking of that, I have another (big) problem. That a look at this picture, please:...
If I click on Start->Run type in something like www.google.com and hit OK, google will open on the default browser. I was wondering how to simulate that programatically. Does anyone know? Thank you.
Tonto, thanks a lot man!
Consider this:
int i;
char *v[MAXELEMENTS];
for (i = 0; i < MAXELEMENTS; i++) {
if ((v[i] = malloc(blablabla)) == NULL) {
printf("error\n");
while (--i >= 0)
I am able to open a website with IE using the ShellExecute function but after doing some stuff, I need to close it. How can I do that programmatically? I tried passing the verb "close" to...
I'm reading a book called Pointers on C and I believe I have found an error but I just want to make sure before contacting the author. Consider this piece of code:
typedef char *a;
int b;
int...
I've been reading, I've been reading... ;)
I can see that Dave's coloring abilities really got to quzah :D
It is not confusing, it's just a matter of reading the function's definition and understanding it. :p
I'm talking like that because I think I finally get it lol.