Maybe because you're trying to copy a char array into a single char?
You could try changing your struct to this:
struct Room {
char south, north, east, west;
char id[2];
char...
Type: Posts; User: mherald81
Maybe because you're trying to copy a char array into a single char?
You could try changing your struct to this:
struct Room {
char south, north, east, west;
char id[2];
char...
I don't think it's good practice to use void main().
/*c program to find out the maximum and the second maximum number from an
array of integers*/
#include<stdio.h>
int main(void)
{
...
Ok here's my updated code. However I'm not too sure how to check without making everything uppercase or lowercase.
...
It's actually not because of 3 consecutive letters, but instead some of the strings in your input has the first character as a lowercase. I will have to work on fixing that.
Give it a try on your own first before asking for help.
laserlight,
Can you look over this and make sure everything is ok.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void swap(char** first, char** second);
int somefunction()
{
if(....)
return value;
.
.
. // Some work here
.
.
}
I think I know, but not sure on the terminology. What is an inline return and how does it differ from a normal return.
Please give me some examples.
Something like this? I'm still messing around with it to get it working but would appreciate any hints or suggestions.
void readInputFile(FILE *input)
{
char *temp;
char username[80];
...
Is there a way to modify it to accept any number of elements? I had the bound set to 10 just to test it out.
Ok, I'm trying to change it up a bit to read from a file but I'm having issues. The function that I'm having trouble creating is readInputFile.
#include <stdio.h>
#include <stdlib.h>
#include...
Thanks, I keep forgetting. I got it working.
Updated it a bit, but still have some issues. It's only sorting based on the first letter. So if I have 2 words that start with the same letter it won't sort correctly.
#include <stdio.h>...
No errors, just that it doesn't sort the names correctly.
original:
"Darin"
"David"
"Brian"
"Dog"
"Nikki"
"Aaron"
"Robert"
I had this working in C++ but wanted to get a C version. I'm pretty sure I'm getting lost with the pointers. I would appreciate any help.
#include <stdio.h>
#include <stdlib.h>
#include...
I need some help understanding function pointers.
syntax:
int (*pt2Function)(float, char, char) = NULL;
I'm just confused on how to really use them and their usefulness.
nevermind, I got it working.
What do you mean?
I'm need some help initializing a pointer. Below is a segment of my code that I'm working on. The pointer that I need help with is subjectPtr.
#include <stdio.h>
#include <stdlib.h>
#include...
So strcat(y, p+1) concatenates without the space at the beginning of p and strncat(y,p,1) concatenates the space at the end. And *p=0 sets where p is pointing to in memory to 0? And the loop will...
Can you explain this loop a bit for me?
while( p!=s )
if( strchr(delims,*--p) )
strcat(y,p+1),strncat(y,p,1),*p=0;
It's mainly the strcat line that I'm lost on because all of...
Thanks. I can see why that would be useful for this program.
What's the difference between calloc and malloc?
I would say use google and search for some reference code and give it a try. I'm in the process of learning C and was able to use google to make sure my syntax is fine and make a binary search tree....
Here's my final edits to get it working.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char a[] = "Dog eat Cat";