So this works?,
Cuz when I run it, it gives a seg fault.
Type: Posts; User: cloudsword
So this works?,
Cuz when I run it, it gives a seg fault.
Good Evening.
I am trying to recreate the reverse String function. I realize there is a strrev() that does the same thing, but I wanted to create my own. After running into many problems, I...
Thanks
int CountCharacters(char* String, char Character)
{
int n=sizeof(*String);
int count=0;
int i;
for (i=0; i<n; i++){
if (*String[i]==Character){
count++;
}
}
What is the difference between a Char* X and a Char *X. In my code for homework we were given a Char* X, and when I tried to access it like a pointed to value (i.e.if *X=='y'), it complained about...
Thanks CommonTater! I've been working with HDL's so long that I did not consider using a while loop.
and how would I do that code wise
So I'm writing this program to write into hyperterminal using button presses and here is a snippet of my code
if (button1==0)//button is pressed
{
uart_transmit('L');
}
if...
Hey
I am trying to set up an 8051 to connect and transfer data to an RS232 and am using C code to do so.
I was wondering if there was an easy way to access the ascii binary of the char.
ie ...
Hey I am having issues, this time with strncmp(). I have initialized the char arrays like vart helped me to do, and now it is seg faulting for strncmp.
I thought that strcat() when it got done, ended the cocatenation with the NULL character.
By the way, how do you "initialize" an array?
Would increasing the size of the buffer that I am using work. Oh and I was using this on a file that was around 5+/- a little bytes, so the size of the arrays that I was using should have been...
ok, so I am writing this code, and I keep getting a seg fault. I went into gdb and it told me that it was seg faulting on the strcat() function.
here is my code
#include <string.h>
#include...
Hello
I am looking for something in the standard c libraries that would perform a CRC checksum. Is there something like this?
Thanks
I want to be able to get entirely out of a conditional tree. how do I do this?
Here is sample code
while(1){ //I want to get back here
if(/*stuff*/){
//stuff...
nope, still does not work!
thanks
thanks rags
I corrected some of my code, but I am still getting the for loop errors
myServer.c:49: error: ‘for’ loop initial declaration used outside C99 mode
myServer.c:55: error: expected expression before ‘!=’ token
myServer.c:64: error: ‘for’ loop initial declaration used...
I've been writing this code for a simple server and am having problems. It says there is something wrong with the way I declared my for loops. I looked at some code I had written previously, and...
I am working on a project and one of the elements within the project is not working as expected. So I wrote a short program to test the functionality.
#include<fcntl.h>
#include <stdio.h>...
Thanks, After getting away from my computer, it came to me that I needed to replace i with something like bytesread%linesize;
thus making your string ready for another set of 16 chars?
Well, doesn't that function clear your string?