I didn't know what the output meant.
As usual, my intuition about you was right. Do me a favor and ignore my posts.
Type: Posts; User: Dave Jay
I didn't know what the output meant.
As usual, my intuition about you was right. Do me a favor and ignore my posts.
Thanks for the response anonytmouse, and not the typical condescending criticism. Some people tend to forget that other people aren't programmers and have lives outside of a computer.
But now I realize that addresses can be different sizes on machines, therefore different byte sizes - scratch the casting operator idea.
What situation will sizeof not work?
Why do you need the casting operator to receive the correct size
of my_array? And what is it outputting if you don't use it?
#include <stdio.h>
char * my_array[] = {"string1", "string2",...
/* Don't name the executable "time.exe", as this is a conflicting
name in some environments
*/
#include <stdio.h>
#define HOURSEC 3600
#define MINSEC 60
void my_time(const unsigned,...
"The expression 0x0FFE yields an integer type and can not be dereferenced. You can use a cast to create an expression that yields a pointer type"
This clears things up a lot.
Thanks guys
this is what has been confusing me but I have, I think, figured out my problem. The semantics of words have confused me a bit too. PLease feel free to correct me if I am wrong.
First, the actual...
consider this definition:
int *func(int *num)
{
return num;
}
what does func return?
if "func" in your example returns an address of an integer, a constant value, say it's a 32 bit address 0x0030FFEE, then why does the dereferencing operator * work with that returned value? I...
i messed up the syntax. Thanks chief.
I know it can in C++ returning a reference variable. Thanks
for( i=0; i<x; i++)
result += va_arg(arglist,double);
what you wrote here, each call to va_arg(arglist,double) refers to the next argument after x. What I'm questioning is how to refer back...
My book does a bad job explaining this topic. The way I understand it, each call to the macro va_arg([variable], [type]) refers to the next argument in the parameter list marked by va_start. So, does...
why does the input buffer flush when response is declared as int?
This is a simple little menu which doesn't work. After a character is inputted, user input is skipped for the next scanf statement if the loop continues. If response is declared to be int, it works,...
klausi : "Can you exactly define "median"? "
The median is simply the middle number of a sorted list.
When there is an even number of numbers, the median is the mean of the two middle numbers.
...
For "unregistered":
You were "assuming the list is in an array", which I had said cannot be in memory. The numbers are spit out on the fly, you read them once individually and then they are gone....
How would you want the program to handle the following:
> 3456348908687874545.76456489056456 + 23.444
> / 17
> 8 ++ 3
is there a limit to how long an expression can be?
How would you, if it's indeed possible, find the exact median of an unordered list, on the fly?
For example, how would you find the median of the following list (which is 5) without sorting the...
A few quick comments:
char inpt[i];
This can't be declared with variable length. "i' must be a constant; the complier must know the size of the array beforehand, like you did with char...
while ( cnt != -1 )
the variable cnt is never initialized and you are comparing it - not good. Note that, from what you've wrote, you don't even need it. You can do something like this for(;; )...
You misunderstood me. I was simply implying "call by reference" by passing a pointer to an argument.
-as in swap(&i, &j);
void swap(int *x, int *y);
You looked too deeply.
Dave
Also i would like to know how can i change color of the text to be displayed on the screen and how to keep the text flashing on the screen.
Specify platform :confused:
In DOS you can use...
I sense you haven't learned passsing by reference yet.
Here's something more manageable, I followed your semantics :cool: :
#include <stdio.h>
int score1, score2, score3;
char grade;
float...
Depending on the memory segmentation of the cpu, it might not be so bad. For example, using near pointers can't address any OS region of memory in DOS. The worse you'll do is wipe out anything in the...