yellowSnow 607 Posting Whiz in Training

Ok the exact error message is -

prog_name(35122) malloc :
*** error for object 0xbfffa878: non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug

OK .. off the bat, that doesn't help that much. I would suggest that you take Tommy Gunn's advice and remove the casts to your malloc() and calloc() function calls.

yellowSnow 607 Posting Whiz in Training

Are you friggin' kidding us?

You need to read this:
http://www.daniweb.com/forums/thread78060.html

and then you need to read this (how to post code):
http://www.daniweb.com/forums/thread93280.html

Good luck!

yellowSnow 607 Posting Whiz in Training

[
..i want to build an student database using linked list and in c language...but i am unable to create nodes for each variable like age,name,roll no,and also i have to implement in that the suboptions like modify ,search ,sort, create n display plz tell me how can i implement this one (a student database using singly linked list)

You obviously have a great deal to learn my friend.

First up, you've bumped an old thread.

After that, you have shown no effort that would even entice any of the talented members of this forum to help you out.

Read this:
http://www.daniweb.com/forums/announcement118-2.html

and try again.

yellowSnow 607 Posting Whiz in Training

The only built in compiler I remember was for BASIC, a long time ago.

Yeah ... I think you're referring to GW-Basic ("Gee Wizz"). I vaguely recall writing some stuff using GW in my first "real" job.

yellowSnow 607 Posting Whiz in Training

Fair enough. My code was an answer aimed at a specific query asked by another forum member.

yellowSnow 607 Posting Whiz in Training

So basically there is no built-in compiler that comes with windows OS?
by the way, whose photo is it in your avatar?

As far as I know, there is no "built-in" C compiler for Windows. Just google MingGW, Codeblocks and Eclipse and you should be right.

My avatar ... well if you're a true lover of music (and I mean real music) you should know. It's a picture of the great one known as "Frank Zappa". If you appreciate FZ, you'll understand the meaning behind the user ID I use on this forum.

yellowSnow 607 Posting Whiz in Training

Add -Wall option when you compile. (ignore!!_

Sorry another brain fart. You need to pass the address of the parameters to your swap function like so:

swap (&i, &j);
yellowSnow 607 Posting Whiz in Training

I would suggest MinGW. A port of the GNU gcc compiler for Windows. Actually you get more than a C compiler, you get C++, Java and Fortran as well.

If you're talking IDEs, then I would suggest Codeblocks or Eclipse - both use the MinGW toolchain.

yellowSnow 607 Posting Whiz in Training

There is nothing about a struct that causes memset() to fail, the problem is with the member types. memset(pobj, 0, n) will set n bytes starting at pobj to all bits 0. All bits 0 is not a guaranteed representation for most of the data types in C. It works for the character types and the exact width types from C99, but every other type can have trap representations from the padding bits for all bits zero that can halt a program. You described your struct as having more than the safe types, so memset() is not a safe option for the struct as a whole. The best you can do portably is manually assign values to each member and wrap it in a function for convenience.

I thought that was the intention of the code I posted - taking into account that I did not provide code based on the CCSID that the code would be accounting for with regards to the data it operates on. For the purposes of this forum, ASCII tends to be a reasonably safe bet.

Regards,
The "fake expert"

yellowSnow 607 Posting Whiz in Training

I am getting this error message, but I am not sure what I am doing wrong?

Here is a edited snip-it of my code -

void WriteProgram(clientProgram *ptrToProgram, int *ptrTotalWkOuts, int *ptrNumOfEx)
{
    int wkOut = 0;

    clientWorkout *ptrToWorkout;
    
    int *autoPopulate = (int *) calloc(1, sizeof(int));

    clientWorkout *ptrToFirstWorkOut = (clientWorkout *)malloc(sizeof(clientWorkout));

    free(ptrToFirstWorkOut);
    free(autoPopulate);
    ptrToFirstWorkOut = NULL;
    autoPopulate = NULL;
}

When I stepped through on the debugger it did not come up, can anyone shed some light on what I am doing wrong?

Regards,
Nate

What is the error message? You state "this is the error message" without telling us the error message.

More info required.

yellowSnow 607 Posting Whiz in Training

Main problem is formatting. Something like this oughta work.

int i,totalPoints=0;
int assignment[6];
for(i=0;i<6;i++)
{
	printf("\nAssignment%d: ",i+1);	
	scanf ("%d",&assignment[i]);
}
for(i=0;i<6;i++)
	totalPoints+=assignment[i];
printf("\ntotalPoints = %d\n",totalPoints);

Did you read my post nimrod?
[edit] Sorry, I didn't read your response .. my apologies[/edit]

yellowSnow 607 Posting Whiz in Training
int main() {
	int assignment1[30]; " ";
	int assignment2[30]; " ";
	int assignment3[30]; " ";
	int assignment4[30]; " ";
	int assignment5[30]; " ";
	int assignment6[30]; " ";
	int totalPoints[] = "assignment1+assignment2+assignment3+assignment4+assignment5+assignment6";

	printf(" Grade calculator ... By Geoffrey Prata \n\n");
	printf(" Please enter your grades \(in points\) after \n each prompt and press the enter key.\n\n");
	printf("Assignment 1:");
	scanf ("%s", assignment1);
	printf("Assignment 2:"); 
	scanf ("%s", assignment2);
	printf("Assignment 3:");
	scanf ("%s", assignment3);
	printf("Assignment 4:");
	scanf ("%s", assignment4);
	printf("Exam:");
	scanf ("%s", assignment5);
	printf("participation:");
	scanf ("%s", assignment6);
	printf(" your total points are:" totalPoints);
		return 0;

}

here is an update version, i am still having problem i just need to find out how to make a mathmatical equation using assignment1-6..

Trust me mate, you have more than one problem. The quality of the code you have posted demonstrates a severe lack of understanding in the core basics of C.

For one you declare six arrays of 30 integers and in the context of your program I still don't understand why you have done this.

Those funky null assignments after each array declaration .. well you've got me heading to the refrigerator for another beer.

Your declaration and subsequent assignment of the totalPoints array is turning me into an alcoholic. And your use of format specifiers in your scanf leaves me hankering for another beer.

All jokes aside - I really don't understand what you're trying to achieve with your program. I have posted a simple code snippet of a program …

yellowSnow 607 Posting Whiz in Training

@nateuni: I have been reading about memset but my understanding is it will not work for a struct.

I think memset is the way to go. You do not have many alternatives.

Yes. I agree. Here's a sample of code I posted about a month ago to another member asking a similar question.

#include <stdio.h>
#include <string.h>

struct employee {
    char name[25];
    char doj[25];
    int empid;
};

void init_emp(struct employee *);

int main(void) {

    struct employee e[3];
    FILE *fp;
    int i, num;
    int k = 0;

    /*Read the details of three employees */
    fp = fopen("empfile.txt", "w");

    for (i = 0; i < 3; i++) {
        init_emp(&e[i]);
        printf("Enter the empid,name and doj: ");
        scanf("%d %s %s", &e[i].empid, e[i].name, e[i].doj);
    }

    //write all three records to the file
    fwrite(&e, sizeof(struct employee), 3, fp);

    fclose(fp);

    //read all three records from the file
    fp = fopen("empfile.txt", "r");
    fread(&e, sizeof(struct employee), 3, fp);

    printf("\nEnter the emp id to see the details\n");
    scanf("%d", &num);
    for (i = 0; i < 3; i++) {
        if (e[i].empid == num) {

            printf("Employee id = %d\nName = %s \nDate of joining = %s\n",
                    e[i].empid, e[i].name, e[i].doj);
        }
    }
    fclose(fp);
    return 0;
}

void init_emp(struct employee *e) {

    const int blank = 0x20;

    memset(e->name, blank, sizeof(struct employee) - sizeof(e->empid));
    //memset(e->name, blank, sizeof(e->name));
    //memset(e->doj, blank, sizeof(e->doj));
    e->empid = 0;
}

I provided some alternatives in the init_emp() function on different ways the struct could be initialised - that's the reason for the couple of lines that are commented out.

yellowSnow 607 Posting Whiz in Training

now im stuck as to how to display it in decending order

Well you've almost done it. Change the comparison in your strcmp() to be "greater than" (>) to sort the names in descending order. In addition to studying up on why gets() is a poor function (use fgets() instead), study up on the strcmp() function as well to understand why a "greater than" comparison will give you the names in descending order.

yellowSnow 607 Posting Whiz in Training

THanks guys, lol but still stuck on the program, the one thing that has me lost , could you guys tell me if the loop area could be improved? Currently i tried to redo the program and declared my statement just like you guys told me to but i somehow feel the program crashes due to the loop not being complete

Try the following code snippet out and see if it matches your requirements. I'm assuming that you just wish to detect a single character input and when the correct key is entered, display a "successful" type message and exit the program. Otherwise keep on prompting the user with that "scary" message if he/she does not input the correct key.

#include <stdio.h>

int main() {
    char KEY = 'a';
    int Guess;

    printf("You have traveled the World's Deserts and you have finally found the cave\n"
                "of Ali Baba. You see the cave shut, and you shout the secret words:");

    while ((Guess = getchar()) != KEY) {
        // this line "flushes" the input buffer
        while (getchar() != '\n');
        printf( "You hear the sound of hooves closing in on you its the bandits, Please hurry and try again\n");
    }
    printf("You have opened the Cave and took all the riches of the Bandits, Well Done \n");

    // pause program - enter any key + ENTER to terminate the program
    getchar();
    return 0;
}

A couple of things to note:
1) Using the getchar() function, you need to flush the input buffer to …

kvprajapati commented: I like the way you answer. +17
yellowSnow 607 Posting Whiz in Training

Fair enough. But this is a C forum. ;-)

yellowSnow 607 Posting Whiz in Training

You're sort of on the right track. How about trying it out for yourself and see what happens rather than constantly asking for examples. And then post back if you still have issues - your learning experience will be far better this way.

Also, learn how to post code properly using code tags. Before posting any code in the future, read the material at this link:
http://www.daniweb.com/forums/thread93280.html

@OP:
Please refrain from sending me PMs telling me that my advice is worthless. If you think that, then put it out here on the forum - I'm a big boy - I can take the heat. Just bear in mind that I'll probably choose to ignore any of your postings in the future.

yellowSnow 607 Posting Whiz in Training

Just having a quick look at your code, you're not declaring your variables of type SYM correctly - you need to prefix the declarations with "struct". If you don't want to do this, you'll need to use a typedef.

yellowSnow 607 Posting Whiz in Training

do any one know the program of predicitive parsing in c?help me.with example

I make no apologies for shouting:

STOP HI-JACKING THREADS!!!

Start a new thread and show some effort in formulating a question that is specific - unlike the vague crap you have posted.

yellowSnow 607 Posting Whiz in Training

You're sort of on the right track. How about trying it out for yourself and see what happens rather than constantly asking for examples. And then post back if you still have issues - your learning experience will be far better this way.

Also, learn how to post code properly using code tags. Before posting any code in the future, read the material at this link:
http://www.daniweb.com/forums/thread93280.html

yellowSnow 607 Posting Whiz in Training

Are you kidding me? Why are you posting this as a code snippet? You should have posted this in the C forum as a "normal" thread". And quite frankly unless you are willing to put some effort in and pinpoint the minimal code that demonstrates your problem, I'd guess you're going to have a hard time finding people here prepared to help you when you dump the better part of 800 lines of code and virtually say "please look and fix for me".

invisal commented: Right! +7
kvprajapati commented: You are absolutely right. +17
tux4life commented: I really like the way you talk English (I learn a lot from it), and yes: you're 100% correct :) +22
yellowSnow 607 Posting Whiz in Training

>>scanf("%s",&Guess);
The "%s" tells scanf() that Guess is a pointer to a character array, not a single character. If all you want is a single character then call getchar() instead. (link)


If you want them to enter "open sesame", which is two words separated by a space, then its a lot easier to declare Guess as a character array then use fgets()

char Guess[80] = {0};
fgets( Guess, sizeof(Guess), stdin);

To add to AD's suggestions, I would get rid of the system("pause") function call and replace this with getchar() as well. I'm assuming you are doing this because you are running the program from within an IDE and you want to pause execution of the program to give you enough time to observe the output.

yellowSnow 607 Posting Whiz in Training

@konohastar.

We'll let you off this time ;) since that was your first post, but in future please use code tags when posting code. You'll find members of this forum more willing to help you out if you do this. Read the material at this link to learn how to post code correctly:

http://www.daniweb.com/forums/thread93280.html

yellowSnow 607 Posting Whiz in Training

A supposedly different thread in disguise.

For the OP - stop wasting everyone's time by creating a new thread when you haven't even bothered with the pending conclusion of your most recently related thread:

http://www.daniweb.com/forums/thread222917.html

yellowSnow 607 Posting Whiz in Training

This would have to be close to one of the most stupid assignments I've ever heard of. It just supports my claims on the quality of CS education these days.

yellowSnow 607 Posting Whiz in Training

can u hlp me about modulu and looping statement?

This old thread has been accidently revived. Stop posting on this thread (I know this is rather hypocritical of me).

Start a new thread and for crying out loud, formulate a proper question. Your rather vague question has no relation to the topic of the original thread in any case!!

Nick Evan commented: Yes +31
yellowSnow 607 Posting Whiz in Training

I am making a program to compute simple interest. P*R/100

this is what i have done... Please tell me whats wrong

int main() 
{ 
int p,n,count; 
float r,si; 

count=1; 
while(count<=3) 
{ 
printf("\n enter values of p,n,andr"); 
scanf("%d %d %f",&p, &n, &r); 
si=(float)p * (float)n * r / 100; 
printf("simple interest =rs. %f",si); 
count=count+1; 
} 

return(0); 
}

We're not in the guessing game here - so how about giving us a hand and telling us what you think is wrong.

For one, if your code snippet is meant to be a full posting of code, then you are missing the include directive for stdio.h. I'm not sure why you have the loop in place. Your code style needs a bit of work. Other than that the "dinky" little piece of code seems to work OK for me.

yellowSnow 607 Posting Whiz in Training

the moving r and basechars made it fail but initializing the k to zero did the trick.

Thanks very much to you and many thanks to salem :)

Not sure why moving those declarations outside the loop would make it fail - it works for me:

#include <stdio.h>

#define SIZE 64

int main(void) {
    int d, b, k=0, i, r;
    char result[SIZE];
    char basechars[] = "0123456789ABCDEF";

    printf("Enter decimal and base:  ");
    scanf("%d", &d);
    scanf("%d", &b);

    if (b < 2) {
        printf("Your base is too low! \n");
    } else if (b > 16) {
        printf("Your base is too high! \n");
    } else if (d == 0) {
        printf("%d \n", 0);
    } else {

        while (d != 0) {
            r = d % b;
            d = d / b;
            result[k++] = basechars[r];
        }
        for (i = k - 1; i >= 0; --i) {
            printf("%c", result[i]);
        }

    }
    return 0;
}

BTW - if you're happy with the outcome - flag the post as solved.

yellowSnow 607 Posting Whiz in Training

Initialize k to zero.
Also, move your declarations for r and basechars outside of the loop.

Kombat commented: Very Helpful +1
yellowSnow 607 Posting Whiz in Training

Wow thanks it works however it is showing a lot of weird symbols along with the answer.

Post your full code.
And don't thank me - Salem is the one you should be thanking.

yellowSnow 607 Posting Whiz in Training

You're making this more difficult than it needs to be. Look at this code snippet:

while (d != 0) {
        r = d % b;
        d = d / b;
        result[len++] = basechars[r];
    }

    for (i = len-1; i >= 0; --i) {
        printf("%c", result[i]);
    }
yellowSnow 607 Posting Whiz in Training

Other than adding the "&" to the scanf statement . . .

Why do you do the following loop?

while(x<=num)		//Checks the numbers for their status
	{

		detect(num);
		x++;
	}

If you want to check all numbers between 2 and num, then you must detect(x) rather than detect(num). Currently, all your program does is print out the result num times, which I doubt is what you want. ; )

I don't get the floating point exception you mentioned on my machine.

I'm not sure why the OP even needs the x variable. Get rid of the loop and the variable x in main().

Also, in the get_sum_of_divs function, you only need to check up to num/2 in the for loop.

for (i = 1; i <= num / 2; i++)

Finally, for the OP, learn how to post code properly - read this:
http://www.daniweb.com/forums/thread93280.html
[Edit]
OK .. I see now, the OP wishes to check all numbers up to the upper bound entered - I thought the number entered was the only number to be checked for "perfectness" or otherwise. Sorry - OP go with Wheel's suggestion.
[/Edit]

Also, in the detect() function, use if-else if - that way you aren't executing any unnecessary additional checks.

yellowSnow 607 Posting Whiz in Training

Stop hijacking threads. Start a new thread and learn how to read. Did you not read my previous post?

SHOW SOME EFFORT!! Your request and that of the OP just show how bloody well lazy the both of you are.

Sheesh.

yellowSnow 607 Posting Whiz in Training

@dkalita,

We do not freely give out code on these forums unless the poster shows some effort. Since you are a "newbie", you need to read this:

http://www.daniweb.com/forums/announcement118-2.html

Salem commented: Well said - dunno what crazy shit the other person was smoking though - must be good whatever it is ;) +36
yellowSnow 607 Posting Whiz in Training

or i have to declare normal structure of same type and make the ptr get its address ?

You can do it that way, or allocate memory to your structure pointer as in:

em1 = malloc( sizeof(*em1) );
yellowSnow 607 Posting Whiz in Training

For the OP - if I'm understanding your issue correctly, you are still experiencing problems getting the strcmp() function to return the fact that two strings are equal.

This is happening because the fgets() function stores the newline character into the buffer and then you are comparing this buffer to a string which you think is the same but it doesn't have the '\n' character. You need to overwrite the '\n' character with a NULL.

Because I'm sick of seeing this thread going nowhere (and I've had a good day at work), here's some code for you to try. Here's the "constraint.txt" file I used:

a1,b1,c3,
a2,b1,c3,
a3,b2,c2,
a2,b3,c1,
a3,b2,c1,

Here's the code that reads the above file into the const_array and then tries to find a string that is equal to append_test_data.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void) {

    FILE *fp = NULL;
    char const_array[100][100];
    char append_test_data[100]="a2,b3,c1,";
    int ctr= 0, i = 0;
    char *p = NULL;

    // open constraints file
    if ((fp = fopen("constraint.txt", "r")) == NULL) {
        printf("Cannot open constraint file.\n");
        return EXIT_FAILURE;
    }

    // read file and load each line of text into array
    // don't forget to overwrite the '\n' that fgets reads into the buffer
    while (fgets(const_array[ctr], 100, fp) != NULL) {
        if ((p = strchr(const_array[ctr], '\n'))) {
            *p = '\0';
        }
        ctr++;
    }

    // check constraint against append data
    for (i = 0; i < ctr; i++) {
        if (strcmp(const_array[i], append_test_data) == 0) {
            printf("Append data is …
yellowSnow 607 Posting Whiz in Training

sum()
integer x,y,z
read x,y
z=x+y
print"the sum of x and y is",z
end sum()

In the relatively short time I've been participating in this forum, this would have to be one of the most irrelevant answers to a thread I have seen.

keerthiga, did you actually read the OP's original query? What a silly little answer.

yellowSnow 607 Posting Whiz in Training

Please let me know what is bb tags, and how to use that.
thanks,
Gaiety

Read the material at this link:

http://www.daniweb.com/forums/thread93280.html

On the front page of this forum, there are a number of threads at the top which as a "newbie", you should read as well.

yellowSnow 607 Posting Whiz in Training

you just need to make the above changes.

Does that include the use of void main() as well? I sincerely hope not.

yellowSnow 607 Posting Whiz in Training

Besides all the other "evils" in your code that others have pointed out already, the logic of your max() function in your last post is incorrect. It appears to be returning the minimum value out of the three values passed in to the function.

You should consider yourself lucky that you're even getting people responding to your thread - you have made 10 posts and you still haven't figured out how to use code tags - although that is probably the least of your problems going by the poor quality of your code. You obviously need to study the core basics of C in more detail. And if you have, then you need to study harder.

Salem commented: I only REPlied ;) +36
yellowSnow 607 Posting Whiz in Training

just use strstr and use its return value to copy it

You really like posting answers that have already been suggested. Do you actually read all the posts in a thread? I don't think so!

yellowSnow 607 Posting Whiz in Training

It can't be that urgent if you can't even take the time to post an actual question. Try again - and ask a question this time.

kvprajapati commented: Well said. +13
yellowSnow 607 Posting Whiz in Training

When using the sizeof operator with a type name, it must be enclosed within parentheses.

yellowSnow 607 Posting Whiz in Training

Use strtok().

The strtok() function is a poorly implemented function and except for the absolute simplest cases (or for demonstration purposes) should be avoided. There are plenty of online references as to the pitfalls of this function.

Unless I misinterpreted the OP's question, it didn't sound like he/she was looking to tokenise the string in any case.

yellowSnow 607 Posting Whiz in Training

Hello Every one,
I need to write a program to copy a part of a String from a specified
place.
Eg: if the first String looks like "This is a C program"
I need to extract the part of "C program"
How can I do this.Please help me.
Can I modify the below program

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main()
{
FILE *f;
char i=0;
char *c;
char d[256];
if((f=fopen("D:\\data\\def.txt","r"))==NULL){
	printf("File can't open.\n");
}
	else{
		while((c=fgetc(f))!=EOF){
		
			printf("%c",c);
		}	

	}
}

I don't mind helping you out, but you really need to start learning how to do your own research. With this question you're dealing with strings so this would suggest that you need to look at the library documentation for string handling functions. This is an essential and valuable skill to learn if you wish to pursue a career in the software development field.

For this particular example, in the first instance, you should look at the strstr() function. I'm not sure what modifications you're looking for in your code snippet. Like your previous post, you have forgotten to return an integer from your main() function (i.e. return 0).

yellowSnow 607 Posting Whiz in Training

Hello every one?I have a program use to copy the contents of an array to a File.But it does not work. when it runs Visual Studio starts to debug. But nothing happening.File contents does not change.Please help me tho solve this problem.Thank you very much.
Here is the program.

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main()
{
FILE *f;
int i=0;
int data[]={1,2,3,4,5};


if((f=fopen("D:\data\def.txt","w"))==NULL){
	printf("File can't open.\n");
}
else{
	for(i=0;i<5;i++){
		fprintf(f,"%s\n",data[i]);
	}
}

}

In your fopen() function call, change '\' characters to '/' in your path. Alternatively, you can escape the '\' character by using "\\".

Other issues:

Your main is supposed to return an integer - you're missing a return statement at the end of your code in main().

Your format specifier in fprintf (i.e. the %s) is wrong. You are writing integers so you need to use %d.

yellowSnow 607 Posting Whiz in Training

You called from main() like
saveToFile(*client_file, &client); //at 33 line
but you should call this function as
saveToFile(client_file, &client);

this may be solve your problem..........

It already did solve the problem sunshine. Refer to post #11!

yellowSnow 607 Posting Whiz in Training

Well I never expected such a reaction to my post #3.

@nateuni
First up, I apologise if that post offended you that much. In hindsight, I perhaps should have let the post sit in draft mode before pressing the ol' Submit button.

In my defense, I had been posting responses to quite a number of posts yesterday on this forum. A majority of these posts were of a similar theme i.e. poorly formatted code, vague questions and postings of "reams" of code (much of which lacked the necessary resources or functions to even get them to compile). But nevertheless I persisted and answered those posts which I thought deserved some sort of reply. Your post was one of the last I answered and the upper bound of my patience had been tested.

In the short time that I have participated on these forums, I have been PM'd quite a number of times by various members with help for problems - this was probably due to my "nice" nature. Initially I responded to their requests and then I realised that I was engaging in a disservice to this forum. I now politely ask the senders of such messages to re-post their queries on the public forum. The reason why I'm ranting on about this is to emphasis that I'm not a "nasty' person. I am passionate about the IT industry and I like to talk IT and mentor others when the opportunity arises. This is one of …

yellowSnow 607 Posting Whiz in Training

How many times do you need to be told to use code tags? It's the third time I have asked you to do this.

The strtok() function has its pitfalls which have been well documented - do your own research on this.

Since this is more than likely an assignment on using strtok(), I will only help if:

1) you post your code again using code tags (AND YOU HAVE BEEN GIVEN THE LINK TO THE NOTES ON HOW TO DO THIS IN YOUR PREVIOUS POSTS!!!)

2) you research how to use the strtok() function correctly and change your code accordingly.

Other than that, from my perspective, you're on your own.

Ancient Dragon commented: good advice :) +36
yellowSnow 607 Posting Whiz in Training

>1. Passing into a function and then into a sub-function.
Did you asked Google? Anyways, I did it for you: http://www-ee.eng.hawaii.edu/~dyun/ee160/Book/chap6/section2.1.2.html

>2. Passing 2d arrays, this had just mucked me up.
http://www.physicsforums.com/showthread.php?t=270319 and http://cboard.cprogramming.com/c-programming/97898-passing-2-dimensional-array-function.html

>3. Making comparisons between pointers and ints
Sorry I did not got this properly to make any remarks. :)

I cannot believe students these days. With all the resources they have at their disposal and we have to put up with "Dear John" posts such as the one posted by the OP.

For crying out loud - YOU GUYS HAVE IT EASY

TO ALL YOU LAZY STUDENTS OUT THERE - use the resources available to you and then post a specific question. It amuses me how these students (so-called) post lines and lines of code and then attempt a subliminal approach to getting their questions answered.

Quite frankly, you can do us all a favour and get out of the CS/IT game altogether.

Just search for some Stanford University lectures on the internet (they're available via YouTube) on "Programming Methodology" and you'll understand my take on the lack of quality in the standard of CS education these days - it's an absolute joke! These courses have been "watered down" so much - and the flow on effect is the standard of questions that are asked on online forums.

PS: To all the "real" students out there (and you know who you are) - …

Salem commented: Ahem to that! +36