Awesome answers. Thank you both for your help.
Type: Posts; User: kwikness
Awesome answers. Thank you both for your help.
I'm reading characters out of a text file and printing them to the console via this code:
ifstream textFile;
textFile.open(s.c_str(), ios::in);
char c = NULL;
while(!textFile.eof()) {...
Thanks guys.
I'm not sure what you mean. I updated my code to:
int lineNumber = 0;
while((c = getc(ifp)) != EOF)
{
fputc(c, stdout); //print char to screen
...
I'm trying to write a program that inserts a number line into a text file.
For some reason, fputc(int, FILE *) doesn't print out the int to stdout.
#include <stdio.h>
int main(int argc, char...
YES!! Solved!! Thank you so much Elysia! The problem was the missing return statement. Sometimes I just need someone to look at my code.
*Bump* Plz help. This is due today =(
Ok.. i'm getting there but i've hit a snag. When I print out the results, nothing comes out for the data of the switched node.
Here's the updated source..
ex32.c
#include "tree.h"
void...
Very clever Perspective =)
How's this look?
BTREE findRightMostLeaf(BTREE root)
{
if (root != NULL)
{
if((root -> left == NULL) && (root -> right)) //node...
Hi, i'm trying to write a function to find the rightmost leaf node (a node with no children).
This is the code I have so far.
#include "tree.h"
void inorder(BTREE root);
int main()
Solved
The problem was in my cmp function. Instead of returning the difference between the two values, i was just returning a -1, 0, or 1.
Hi, I'm writing a program that reads data out of a text file and into an array of "student" structures.
The array of structures is then sorted according to "grade". If two students have the same...
Thank you brew.
Hi, i'm having touble with this macro. The compiler is telling me that I have a stray backslash. I'm new to this preprocessor stuff and haven't been able to find a good, straightforward guide to it....
lol oops.. didnt see i had that defined as an int
Vs is good to start with
Hi, I have the following source:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
I want to accomplish what these statements do:
char *temp[10];
*temp = *b;
But on one line.
As in: I want to initialize a char pointer and assign it the value of *b
I understand, but how would I accomplish both the initialization and declaration in one line?
Hi I was messing around with pointer in my program and ran into a problem. The compiler was giving me an initialization error for:
void swap(char *a[10], char *b[10])
{
char...
Thank you very much for clarifying that for me. My program works now. Now time to start on the string sorting part of the application.
3 Questions:
Why is the compiler still giving me a warning if the function parameter and function call match now? (When I don't use -Wall)
In a previous post, you (Salem) told me to include the...
Thanks Salem, you're always a great help. =)
StringSort.c:25: warning: passing arg 1 of `printDat' from incompatible pointer type
for the following code:
#include <stdio.h>
#include <string.h>
www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
Found the section on epsilon comparisons especially helpful. Thanks.