If you declare a variable inside of a loop, the compiler should throw an error, though it may only do it if the loop is going to go more than once. Sometimes you will need to initialize a variable...
Type: Posts; User: madmax2006
If you declare a variable inside of a loop, the compiler should throw an error, though it may only do it if the loop is going to go more than once. Sometimes you will need to initialize a variable...
I figured he/she would get a kick out of it, my bad..
Thanks a lot, this is the 2nd time I've encountered this problem and I couldn't remember why. I'm definitely reading it.
Apparently everyone's stuff works except for using spaces. Here's my code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
Grab a pen & paper, put the pen in your hand, make sure the tip is exposed & start moving the tip of the pen on the paper.
pch = strtok (str," \t\n");
Nevermind for the moment, the infinite loop is somewhere else.
I'm trying to figure out how to get the delimiter parameter to consist of a space, new line, and tab. Is it as easy as putting " \t\n" for the 2nd parameter?
I'm thinking it's not that easy. ...
And yes, I've been reading it over & over since you posted it.../facepalm
I'm still not getting it, do you think you could explain a bit more about how to tell where the split is? Am I...
I assume you mean - once I have the order (A1(A2A3))A4 that I would multiply A2xA3, then that product by A1, and that product by A4. That's my problem, I'm not sure how to implement it that way. I...
I'm just not getting something here, and I have no idea where I'm lost, and I don't know what questions to ask. I'm getting a bit frustrated, so please, take it easy on me.
I have an algorithm...
I want to make sure all memory is free (From malloc). I'm barely allocating space, so I can't really tell from System Monitor. Not to mention everything on google is people complaining about...
Worst case scenario if you're going to school - your professor or TA sees that you were getting help on this forum. If they have a problem with it - take it to the Dean.
Nobody is mad at you,...
I don't know how in-depth you're going to be with this, but you could always end up testing to see if the first character is an integer (==1, ==2, ..., ==0), then the second, and so on. If one of...
Thanks :) I got it working, now I have a question about pointers with char.
char getFileName()
{
char temp[20];
printf("What's the name of the file?\n");
Awesome...I have no idea why I didn't think of that, thanks.
Also: is there an online place that i can type a function in so I know which library that function is in? (Or is google best for that)?
I'm using scanf to ask for a file name. How would i make it so that .txt is automatically added, so the person does not have to add it?
i.e.
So, if the person types in "graph", it will...
If anyone wants to know what the code looks like (note, I didn't include main because it's totally irrelevant, along with the readFile function, I get the correct pointer returned):
int...
Per wiki: In an AVL Tree, the heights of the two child subtrees of any node differ by at most one;
I am not getting this at all, I was going to post it yesterday before I went to sleep, but I...
I'm just wondering, what is the point of moving to the new processors? I.e. Core i7
I was reading something on-line (so I have to take this with a grain of salt), and the guy was saying that...
Just put a 0 in front of the % and you'll be good to go. I'm interested to see if there are any other ways.
I tried doing doing x = 02; and printing it your way, but it didn't work either.
I...
I'm a little confused on what an "Inorder Traversal" is. All the sites I go to say:
1. Traverse the left subtree; and then
2. visit the root; and then
3. traverse the right subtree.
...
I can't stand having a project unfinished, I don't know how you all do it. If I stop, I spend the next hour trying to figure out where I left off. Maybe that will change with experience, but it...
Updated, thanks for pointing that out.
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *file;
Another minor thing I see is that you just say:
int option;
You want to set it equal to something other than zero. It may work 99% of the time, but that 1% of the time may be the 1% that...
Ah, that makes much more sense.
I'm trying to write code so it will move like you have in your lines, but I have a logic error somewhere (probably in my brain - lol).
code & problem on post...