User Profile
Collapse
-
How do you have your 2507 setup to connect to the modem. ANy help would be appreciated. Droulic -
This is being designed for a backend commandline interface for an os.. i dont want a numbered system because the commands are always gonna be a word. ie exit or help... Otherwise that would be a perfect solution. -
I think that the best solution is a mouse driver. That is, make a program that recieves signals from the keyboard and then sends them bask to the os as the mouse signals... Basically you would be writing the windows equivilant of MouseKeys.... This would in effect take a section of the keyboard and make it function only as the mouse. (might as well use the number pad on the right, egh...)
7 8 9
4 5 6
1 2 3
...Leave a comment:
-
If you could post the portion of code where you think the bug might be, someone might be able to better help you. Right now based on the description.... I think is is a variable scope problem...Leave a comment:
-
You know i have too much time on my hands... My signature will now compile in GCC. I really need a life.. The next challenge will have to be: How to best abuse the Preprocessor...Leave a comment:
-
A better way to write the switch/case statement.......
I need some suggestions on how to betterer write the following code. I tried the array of arguments, and san through for a match then strcmp but i get massive errors. The code below is the only way i could get it to work.. if some one has any sugestions on hjow to make this better please let me know... The definiton of the class was left out intentionally. if you need this please let me know
...Code:int EXIT=1; int main()
-
Check the differences between the declaration and the two calls.
The top one is coming back undefined because the linker is expecting a value to be passed to the function.Code:DP trapzd(DP func(const DP), const DP a, const DP b, const int n) s=NR::trapzd(func,a,b,i); s=NR::trapzd(func(const DP),a,b,i);
--
The one and only.... -- Uh, What am I ...Leave a comment:
-
Using the for loop, it is down to 85 characters. Still not as good as 58 though. Just goes to show you how uselessly verbose java is.
Oh, and please post the character count. Will make this a bit easier and eliminate the guess work. Thank you.Code:class f{public static void main(){int a=1,b=1;for(;b<4182;a=b+(b=a))System.out.println(b);Leave a comment:
-
That is correct. I should also have specified that Preprocessor directives are not language code, so they do not count twords the end character count. And thankyou for pointing out my mistakes. I will be the first to admit that i am a novice programmer....
So to answer you question...
The code does count for a total of 58 characters....Code:int main(){for(int i,j=1;i<2585;){printf("%d %d ",i,j);i+=j;j+=i;}}Leave a comment:
-
Thank you Banfa. I will take into account that is is bad practice and remeber it for next time. As I previously stated before, I was mad at the computer so i threw some code at it. But now i realize my only mistake was a comma... I was tired and not thinking straight.
Well, Now that this project is finished.. Guess what language my teacher said to take the same program an write it over again in....?Leave a comment:
-
Ok, I was mad at the computer cause the code did not work... And i made this function. I have no idea how it works? Can someone please explain this to me?
[CODE=c] System init()
{
System system = {{getline}, {println};
return system;
}
int main()
{
System system = init();
}
[/CODE]Leave a comment:
-
CHALLENGE: Shortest Algorithim for Fibonacci Sequence on ONE line
The challenge is to create the shortest algorithim, In any programming language.
RULES:
1. All code must be on one line.
2. Languages that prevent this are disallowed. I.E Assembly, and of course COBOL. All other languages are fair game.
3. Sequence must go up to at least 4181.
If i missed a languge that should be disallowed please let me know...
My solution is in Java. weighing in @ 108... -
Making C User Friendly...
I an currently working on an os project, and it has take a twist. I have started writing classes on top of c to make it easier to use. Its actually starting to look a lot like java. Do you think that programmers would use a java like superset of C for their lower level programming needs? As of right now all of the function calls have workarounds for 32 bit protected mode. Would this have any value if i made it available for download? -
What did i do, and why does this obfuscated code work.?
...Code:typedef struct Out { void (*println) (void); } Out; typedef struct In{ void (*getline) (void); } In; typedef struct System { In in; Out out; } System; void println (void) { printf("\nsystem.out.println \n"); } void getline (void) { printf("\nsystem.in.getlineLeave a comment:
-
[CODE=c]
typedef struct Out {
void (*println) (void);
} Out;
typedef struct In{
void (*getline) (void);
} In;
typedef struct System {
In in;
Out out;
} System;
void println (void)
{
printf("system. out.println \n.");
}...Leave a comment:
-
Ok... So I spoke with my teacher and he says that C will be the hardest language to implement this in so he said to use C. This class is about Logic and i understand his reasons.. I still have a couple of questions though...
I know that system is the base structure and we are creating an instantiation of it called system but what does the right had side of the equal mea...Code:System system = {{actual_println}};Leave a comment:
-
One more thing... How would i define this as a namespace to have a function call like so??
EDIT: Used code tag CPP colors were way too intense. Changed to text.Code:#include <customSystem.h> using namespace System::Out System::Out::println("hello"); // equivilant to printf but with no bios calls...for use in protected mode...Leave a comment:
-
So i could do this in c++ like so?
...Code:using namespace std; class System { public: System (); ~System (); // do i have to define out here in some way? }; class System::Out { public: Out (); ~Out (); void println(); } // and of course i have to define all the functions...Leave a comment:
-
Your welcome. Actually Banfa gave the answer I just made it easier to understand.Leave a comment:
-
Is it possible to have multiple layers of nested functions in c
I am curious if its possible to create a structure for an small SDK smiliar to that of java for C/C++. IE a System.Out.prin tln() that prints a statment in c?
I would guess i would have to use a struct to create system first but how would i nest the other structs beneath it, and could i still access the functions in the same manner.... System would have a Timer() function as well as Out witch is another Struct ... Is this possible.....Last edited by DaemonCoder; Mar 9 '08, 06:00 PM. Reason: Added another Code Sample.. / added end code tag
No activity results to display
Show More
Leave a comment: