- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 2
- Upvoting Members
- 3
- Downvotes Received
- 4
- Posts with Downvotes
- 3
- Downvoting Members
- 3
16 Posted Topics
So everything in my program works except for the main itself. The program is supposed to take in a file provided through standard input and print out the descending order of words followed by the frequency that they occur. I can do this individually line for line but am having … | |
suppose I have: [CODE]#define special_for(X,Y) { register int i = 0; for (;i<X;i++) {Y} }[/CODE] It is used in the following functions: [CODE]init_lineholder(int nlines) { [COLOR="Red"]special_for(nlines, lineptr[i] = (char *)malloc(MAXLEN); tmp++;)[/COLOR] }[/CODE] AND print_lines() { [COLOR="red"]special_for(tmp, if (lineptr[(first+tmp-i)%tmp] == NULL) break;[/COLOR] else printf("%s\n", lineptr[(first+tmp-i)%tmp]) ; ) /* had to space … | |
So I have an assignment that I have been attempting for 2 weeks now and the class has been given extensions twice now. Everyone seems to be struggling with this part of the assignment. The assignment is to do K&R Exercise 5-13, unix tail command. [COLOR="Red"] Instructions: "The program takes … | |
So I have written a reverse polish notation calculator: [CODE] #include <ctype.h> #include <stdio.h> #include <stdlib.h> #define NUMBER '0' #define MAXOP 100 int main () { int type; int op1, op2; char s[MAXOP]; while ((type = getop(s)) != EOF) switch (type) { case NUMBER: push(atoi(s)); break; case '^': push ((unsigned … | |
Re: Here is a thread from a month or so ago of me working through the same problem. [URL="http://www.daniweb.com/forums/thread226007.html"]http://www.daniweb.com/forums/thread226007.html[/URL] The solution is listed and works In case you don't care to take a look: [CODE]#include <stdio.h> #include <stdlib.h> #define MAXLINE 1000 /* This program will remove all trailing white space from … | |
Please help me find the endless loop and how to fix it: [QUOTE]blade71(555)% showxbits_2 32 in itox, processing 32 Test Value (b div 16): 2 Value of b: 32 Value of b (# mod 16): 0 [/QUOTE] [CODE]/* * stubs for functions to study * integer-hex conversions * */ #include … | |
I have already completed my hex to integer conversion function which works properly with the provided driver. However, my integer to hex function gets stuck in an infinite loop and I have no clue why. The red section of my code is the function which is giving me problems. Everything … | |
Why am I getting the wrong output? I have a feeling it has something to do with using type char vs. int....but im not specifically too sure. Please help! [CODE]1. blade71(130)% gcc -o vt visitype.c 2. blade71(131)% vt < vt.in > vt.out 3. blade71(132)% cat vt.out 4. The code 55 … | |
I receive the following error when I compile my code: [CODE]blade71(154)% gcc -o vt visitype.c Undefined first referenced symbol in file aVal /var/tmp//ccrbSM18.o ld: fatal: Symbol referencing errors. No output written to vt collect2: ld returned 1 exit status blade71(155)% cat visitype.c #include <stdio.h> #define MAX 1000 void aVal(char asciiname[], … | |
[CODE]#include<stdio.h> #include <stdlib.h> #define MAXLINE 10000 void reverse(char *str); int main() { int c, i; char j; char S[MAXLINE], *p1; p1=S; for(c=getchar(); c!=EOF; i++) { S[i]=c; } reverse(p1); return 0; } void reverse(char *str) { if(*str) { reverse(str+1); putchar(*str); } } [/CODE] Please help me correct the segmentation fault. [QUOTE]blade71(107)% … | |
Instructions: Trailing blanks and tabs are defined as blanks and tabs that precede a '\n' character or an EOF to terminate a line, without any intervening characters of other kinds. You should copy a getline() function of the kind you see in the text to read in lines from stdin … | |
This is the error I have been receiving when trying to compile my code: [QUOTE]blade71(45)% gcc -o trim trim.c Undefined first referenced symbol in file getline /var/tmp//ccYdyoM3.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status [/QUOTE] My source is only a rough … | |
Hello, I have been given an assignment in which I am to write an assembly language version of the following binary search function & use a suitable main program written in C to test my function. The function in C in which I had to translate to assembly is: [CODE]int … | |
This is a part of my homework. I have completed part 1. Part 2 asks that I re-write my part 1: [CODE]"Write a modified version of part A, in which the function is to be called as though it had the following prototype: void sumPowers(int n, int *pSum);[/CODE] is this … | |
![]() | Re: Why don't you just SSH a linux server and use VI or emacs to edit and gdb to debug and run? If this is not a option try this: [URL="http://www.easy68k.com/"]http://www.easy68k.com/[/URL] ![]() |
Now i'm not asking for a complete easy answer or source, so please take the time to help me. I would like a very detailed explanation telling what to do, I have no idea. I am very confused by stacks, functions, pushing, popping, and all that. I am very new … |
The End.