ctype.h - Wikipedia, the free encyclopedia
Check out toupper.
Type: Posts; User: Phenax
ctype.h - Wikipedia, the free encyclopedia
Check out toupper.
if((spData = fopen("in.text", "r")) = NULL)
Look closely at that line. Not sure if it's directly related to your problem however.
I'm taking an intro to C class @ a university in Florida.
1) Our professor recommend DevCpp (MingW). He recommended GCC on Linux and Xcode on Mac. He mentioned that they were probably going to...
radius = m;
Do you mean
m = radius;
Your file ends in .cpp. You are asking for help in the C subforum.
You can only return one variable or value. You are attempting to return multiple variables in your scan() function.
The pointers...
I would imagine some automatic code generators may hit that, if they are really bad or have a bug. But I couldn't imagine any human coding that.
Also, I edited it for clarification: That's a...
at least 15 levels in C89 and at least 127 levels in C99. Most compilers will support any amount, until you are limited by your own resources, I'm guessing.
Though if you've got that many nested...
This should help you with your problem.
When you pass an array to a function, it decays to a pointer. A pointer is just something that points to a memory address. If you pass a pointer to a...
What is it that you need help with? Calculating remainders? Operators in C and C++ - Wikipedia, the free encyclopedia Check out the "modulo" operator.
Well,
I'm sure there are at least a few individuals here willing to help you understand and solve your problem. What are you going to do on your final exam? You can't pay someone to take that for...
If you want to do a modulo with a fractional numerator or denominator, try using fmod from math.h. The % operator is for integers only.
char sentences[3];
Is an array of three characters.
Or a string of two characters with a null terminator.
Character arrays that have the purpose of being a string should end with a null...
Remember! x++ will increment x after the assignment. ++x will increment x before the assignment!
a[1] = 1
i = ++a[1] will increment the value of a[1], and do it before the assignment. so i = the...
stdio.h - Wikipedia, the free encyclopedia
You're probably wanting to use functions like:
fopen, fclose, fgets, etc.
Actually, sizeof(a) is equal to sizeof(int *) not sizeof(int). Arrays passed to functions decay to pointers.
NCurses is pretty popular on Unix-like operating systems, but there is PDCurses for Windows. PDCurses has a lot of compatibility functions to help it act like NCurses. And a lot of the functions have...
Do you have to code this using C89? C99 has flexible arrays, which would make it easy. Most modern compilers usually have a switch to turn on C99.
If you have to work with constants in the...
Dynamic memory management is definitely the most satisfactory answer to your question. But I would just stick with being a little bit inefficient and not using things your professor hasn't taught you...
ctype.h - Wikipedia, the free encyclopedia
type.h is your friend.
Also, scanf can scan multiple variables in a specified format. Google it up!
Maybe I'm totally misunderstanding but can't you do
int size = 2000;
int oldAry[size];
scanf(...); //get user input
int newAry[size - userinput];
for(...) //copy oldAry contents to newAry
My mistake, statics are indeed initialized to 0 by default. But I think it'd be better to explicitly initialize it to 0 to be clear about your intentions.
Are you able to post the purpose of this code, or some specifications? Because to me, it seems like the only way to accomplish this is making a new array and copying previous data (Which isn't a...
Yeah, sorry, I misinterpreted your question.
if (num = 0)
== tests for equality. Using = is different then ==. Your current if statement does this: Sets num to zero. This operation returns...
Your function prototype in main
void change(double, int, int, int, int);
Is different than the actual declaration of your function
void change()
Looking at this problem, I would try to use dynamic memory management. But if it hasn't been taught in your class before, your instructor may be seeking a different answer here. You can't re-size...