If that is the case, you will get an incorrect count for words with this code. Because, every time it encounters a ' ' words increments. So if there happen to be 3 ' ' between a word, the count would...
Type: Posts; User: Mark Labarbara
If that is the case, you will get an incorrect count for words with this code. Because, every time it encounters a ' ' words increments. So if there happen to be 3 ' ' between a word, the count would...
I have no idea, I am pretty new to programming.
Either way, when you compile and run it, the output is pretty sweet :D
Just saw this and thought other people might enjoy it. If you can't tell from the code, I strongly recommend compiling/running. :)
#include<stdio.h>
char *c[] = { "ENTER", "NEW", "POINT",...
Awesome, thanks again!
I think I have enough to keep myself occupied till next semester starts :)
Yeah I have been surfing that site since your last comment. However, I can't seem to find exactly what I think I am looking for. On this page it lists all of the documentation for every version. I...
Alright I will, should be easy, I use gcc lol.
Anyways, thanks for the advice.
Ah, makes sense why I have not come across them yet. I just finished my first college semester of C and the book we used, IMHO, was terrible (C programming for the Absolute Beginner).The teacher was...
I am reading some code (K&R Questions) but cannot figure out what '->' means. I have seen it a few times, and have tried searching around but have not come up with an answer. Just for an example,...
Look up dynamic arrays or more specifficaly malloc(), calloc(), and recalloc().
As CommonTater said, that won't work either. If you look at the link I provided you should see how you can fix your original code with about 5 edits.
Its not anger, friend. People just want others to learn and think for themselves, that way the can become better programmers. That is all :)
Spoon feeding him answers doesn't really help him learn.
The reason it will not calculate properly is because you have a SIGFPE (Floating Point Exception), and therefore will not run. GDB calls it an Arithmetic exception.
Read up on SIGFPE here to...
Oh alright, makes sense!
Thanks guys, I appreciate it :)
Thanks! Why would the program still execute the sleep() function without the correct header included, though? Because it still executes the sleep function, it just gives the warning.
Hey guys. So I have been learning C for a couple weeks now, and I ran into something I can't quite figure out. I am using gcc 4.6.1 on Linux to compile my programs. I have also been using the -Wall...
Awesome!
Thanks everyone for your tips and suggestions, I really appreciate it :)
Lol, nice!
What book are you using? I am using "C Programming for the absolute beginner, Second Edition by Michael Vine"
So would this be the best way to write the program?
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
int main(void){
Thanks for the critique :)
I am curious about a few things though (please forgive me, I am quite new to this)...
Why does main have to be declared int main(void)? Will it effect more complex...
Hey guys,
This program does exactly what it is intended to do, I was just wondering if it is the best way to accomplish this task. The program searches 'sentence' for str1, str2, or str3 (as...
Just wanted to post the program that I wrote with the help from you all.
#include <stdio.h>
#include <stdlib.h>
float fGpa[10];
int orderAscending(const void* elem1, const void*...
Thanks for the advice!
I am curious though, I thought that when you initialize a a variable like
int x;
it automatically initiates to zero?
Also, why do I want to have main return an...
Crap! I spoke to soon lol.
Now, when I enter in all the GPA's ( I am doing 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, for simplicity) it prints iGpa[0]=2.00000 instead of 1.00000.
I am messing around with...
Thanks a bunch fellas! I got it to work. You are awesome!
The last problem I was it was telling it to store the gpa's in elements 1-10 because I initiated x at 0. So, I changed x to initiate at...