Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
4
Posts with Downvotes
2
Downvoting Members
4
1 Commented Post
0 Endorsements
Ranked #4K
~9K People Reached
Favorite Forums
Favorite Tags
Member Avatar for rockerjhr

ok so I was doing a a function that would find the square root of a number to a certain precision using newtons method and this is what I came up with /* * File: main.cpp * * * Created on July 6, 2012, 6:58 PM */ #include <iostream> #include …

Member Avatar for mike_2000_17
0
1K
Member Avatar for rockerjhr

pushl %ebp movl %esp,%ebp pushl %ebx movl 8(%ebp),%ebx leal 2(%ebx),%edx xorl %ecx,%ecx cmpl %ebx,%ecx jge .L4 .L6: leal 5(%ecx,%edx),%edx leal 3(%ecx),%eax imull %eax,%edx incl %ecx cmpl %ebx,%ecx jl .L6 .L4: movl %edx,%eax popl %ebx movl %ebp,%esp popl %ebp ret trying to make code in c then compiling it with the …

Member Avatar for BlZbB
0
251
Member Avatar for rockerjhr

UniversityDatabse.h [CODE]#include<string> #include<stdexcept> #include<iostream> #include<map> #include "UniversityPerson.h" class UniversityPerson ; using namespace std ; #ifndef UNIVERSITYDATABASE_H #define UNIVERSITYDATABASE_H class UniversityDatabase { public: UniversityDatabase() ; ~UniversityDatabase() ; void print() ; void Create(UniversityPerson *p ) ; void Delete1( string name ) ; void Delete2( string id ) ; UniversityPerson *Lookup1(string id ) …

Member Avatar for ravenous
0
394
Member Avatar for rockerjhr

Im new to asembly in general and im trying to learn but i kind of not get a lot of stuff in IA32 how do I convert this: [CODE]pushl %ebp movl %esp,%ebp movl 8(%ebp),%edx movl 12(%ebp),%eax movl %ebp,%esp movl (%edx),%edx addl %edx,(%eax) movl %edx,%eax popl %ebp ret[/CODE] to C ? …

Member Avatar for rockerjhr
0
119
Member Avatar for rockerjhr

so i have to make a function that displays the binary representation of a 32 bit integer this is what i have [CODE]#include<stdio.h> #include<stdlib.h> #include <string.h> #include<stdio.h> void inttobin(int c) { char * s ; char * p ; size_t n = 8*sizeof(unsigned int); p = malloc(n*sizeof(char)); while (n-- > …

Member Avatar for Narue
0
126
Member Avatar for rockerjhr
Member Avatar for nuclear
0
149
Member Avatar for rockerjhr

Card shuffling and dealing create a program to shuffle and deal a deck of cards,the program should consist of a clas card a class deck of cards and a driver program To deal a card, the driver just prints it out. The dealCard function does not print anything. this is …

Member Avatar for raptr_dflo
0
166
Member Avatar for rockerjhr

if you declared/defined a virtual function for a class and redefined it in a derived class so that when you call the derived class it calls its own version of the function and not the base class function , how do you call the base class function on the definition …

Member Avatar for Fbody
0
191
Member Avatar for rockerjhr

Ok so i have to create a program that computes the convex hull of a bunch of random points but i have no idea where to start i mean i know how the program is supposed to work since you can just easily look up the pseudo code but i …

Member Avatar for raptr_dflo
0
217
Member Avatar for d_panayotov
Member Avatar for rockerjhr
0
199
Member Avatar for tubby123

guys, we use like a 2-d array very often. But what exactly is the use of a 2-d array ? Now when i look at it, i feel everything can be done using a 1-d array and incrementing the pointer appropriately. Is the only advantage of a 2-d array , …

Member Avatar for rockerjhr
0
149
Member Avatar for rockerjhr

main.c [CODE]#include "stack.h" #include "stack_interface.h" #include "lex.h" #include <stdio.h> #include <stdlib.h> #define PUSH(s,c) if(push_char(s,c) == ERROR){ printf("Fatal error in pushing symbol on stack.\n") ; exit(1) ; } #define POP(s,c) if(pop_char(s,c) == ERROR){ printf("Fatal error in poping symbol off stack.\n") ; exit(1) ; } #define TOP(s,c) if(top_char(s,c) == ERROR){ printf("Fatal error …

Member Avatar for Narue
0
250
Member Avatar for Sourish90

Dear Frnz, I am new to this community.....I wanted help from you guys... I want to clear as well as strenghthen my concepts of data structures...I am planning to implement them in C.....I am follwing [B]Tanenbaum[/B]...but i am not completely satisfied with it..... Can you guys suggest which can be …

Member Avatar for tomato.pgn
0
237
Member Avatar for rockerjhr

Suppose there are n ducks floating on the pond in a circle. The pond is also home for an alligator with a fondness for ducks. Beginning at the 1st position, the alligator counts around the circle and eats every mth duck (the circle closing as ducks are eaten). For example, …

Member Avatar for rockerjhr
0
192
Member Avatar for write2diba

I am a beginner in C programming language.I have seen many compilers around but I cannot understand which one will be better to use.Plz help me. Thanks....

Member Avatar for rubberman
0
2K
Member Avatar for rockerjhr

globals.h [CODE] #ifndef _globals #define _globals #define DATA( L ) ( ( L ) -> datapointer ) #define NEXT( L ) ( ( L ) -> next ) typedef enum { OK, ERROR } status ; typedef enum { FALSE = 0 , TRUE=1 } bool ; typedef void *generic_ptr …

Member Avatar for rockerjhr
0
136
Member Avatar for Sheldon.

I really need to find out the correct syntax for passing a two dimensional array.

Member Avatar for Sheldon.
-1
71
Member Avatar for rockerjhr

radixsort.c [CODE]/**************************************************************************************/ /* Radix Sort of integers numbers using polymorphic linked lists. */ /**************************************************************************************/ #include <stdio.h> #include "list.h" #include <stdlib.h> #include "numberinterface.h" #include <math.h> void static refill( int A[] , list Bins[] ) ; int static getdigit( int number, int position ) ; int main( int argc, char *argv[] ) …

Member Avatar for Ancient Dragon
0
236
Member Avatar for rockerjhr

How do i know if two linked lists are set equal? if L1 and L2 are linked lists set equal meaning the set of values of the nodes in L1 is the same as the set of values of the nodes in L2 and order does not matter i know …

Member Avatar for L7Sqr
0
868
Member Avatar for rockerjhr

if i have an array of ints and an array of lists like : list Bins[10] and i initialize all the lists in the bins array to null except bins[3] and lets say Bins[3] has 1 node that has the number 8 in it how do i get that number …

Member Avatar for griswolf
0
103
Member Avatar for rockerjhr

this is what i have so fa r globals.h [CODE] #ifndef _globals #define _globals #define NEXT(L) ( (L) -> next ) #define DATA(T) ( (T) -> datapointer ) #define LEFT(T) ( (T) -> left ) #define RIGHT(T) ( (T) -> right ) typedef enum { OK, ERROR } status ; …

Member Avatar for abhimanipal
0
184
Member Avatar for rockerjhr

globals.h [CODE] #ifndef _globals #define _globals #define NEXT(L) ( (L) -> next ) #define DATA(T) ( (T) -> datapointer ) #define LEFT(T) ( (T) -> left ) #define RIGHT(T) ( (T) -> right ) typedef enum { OK, ERROR } status ; typedef enum { FALSE=0 , TRUE=1 } bool …

Member Avatar for WaltP
0
180
Member Avatar for rockerjhr

[CODE]i need a function that checks in two linked lists are equal thi is what i have so far bool equal(list L1 , list L2 , int (*p_cmp_f)() ){ if( L1==NULL && L2==NULL) return TRUE; else if( L1==NULL || L2==NULL) return FALSE; else if( (*p_cmp_f)(L1->data,L2->data) == -1) return FALSE; else …

Member Avatar for rockerjhr
0
206
Member Avatar for rockerjhr

[CODE]#include <stdio.h> #include <stdlib.h> #include "globals.h" #include "list.h" status write_int(generic_ptr p_n)){ printf(" %d " , *(int *)p_n ) ; return OK ; } int compare_int( generic_ptr x , generic_ptr y){ if( *(int*) x < *(int *)y ) return -1 ; if( *(int*) x > *(int *)y ) return 1 ; …

Member Avatar for rubberman
0
198
Member Avatar for rockerjhr

quicksort.c [CODE]#include "quicksort.h" int compare( byte *a , byte *b ) ; void memswap( byte *s, byte *t, int count ) { byte tmp ; while (count-- > 0 ){ tmp = *s ; *s++ = *t ; *t++ = tmp ; } } byte *select_pivot(byte data[], int n , …

Member Avatar for gerard4143
0
245
Member Avatar for rockerjhr

I need to use mergesort to sort the data in a file that has the names and ages of 10 different people , first i have to sort the names in ascending ascii order and then i have to sort them by their age but im not sure how to …

Member Avatar for rockerjhr
0
209
Member Avatar for rockerjhr

ok here are the files [B]globals.h[/B] [CODE] #ifndef _globals #define _globals #define DATA( L ) ( ( L ) -> datapointer ) #define NEXT( L ) ( ( L ) -> next ) typedef enum { OK, ERROR } status ; typedef enum { FALSE = 0 , TRUE=1 } …

Member Avatar for Adak
0
274
Member Avatar for rockerjhr

i have to impplement a dynamic stack to create a program but when i try to compile my stack.c file(with gcc) I get a bunch of errors here are my files GLOBALS.h [CODE] #ifndef _globals #define _globals #define DATA( L ) ( ( L ) -> datapointer ) #define NEXT( …

Member Avatar for rockerjhr
0
305
Member Avatar for rockerjhr

could someone explain to me why the compiler(gcc) outputs a warning that the control reaches the end of a non void function? [CODE] #include <stdio.h> #include "stack.h" #include "globals.h" #include "stack_interface.h" #define ERR_PUSH "Error in pushing symbol (character #%d).\n" #define ERR_POP "Error in popping symbol tp match character #%d.\n" #define …

Member Avatar for nezachem
0
215
Member Avatar for rockerjhr

trying to do a program that sums all the even numbers in the sequence but i think im doing it wrong heres my code [CODE]#include <stdio.h> int fib ( int n ); int main ( int argc, char *argv[ ] ) { int i , sum = 0 ; for(i …

Member Avatar for rockerjhr
0
101