never use your email address like that. Spambots pick it up and will spam you.Originally Posted by ahluka
do:
ahluka_lt "at" hotmail "dot" com
-Kyle
never use your email address like that. Spambots pick it up and will spam you.Originally Posted by ahluka
do:
ahluka_lt "at" hotmail "dot" com
-Kyle
I never thought of that. It's ok I get enough variations of spam in there anyway so a bit more won't hurt.
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
To [email protected]: Fr33 v!4gRa N0w!
I'm SURE I'm gonna regret doing this, but...
jafet .^. at .:. vixle .!. Dotcom
I can tell you, I haven't even started Windows GUI yet! You need to be patient, and work on things you're capable of. Even the most senior programmers here (or anywhere else) aren't perfect, and still make mistakes, and don't know how to make a Doom IV clone. I'm talking about 20+ years programming experience here. So don't be too quick on the draw either.
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
1Originally Posted by jafet
I think it's probably best you take Salem's advice regarding an interpreted language.
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
What do you thinks looks easier to learn:
This is BASIC
This is CCode:10 print "Hello welcome to programming in BASIC" 20 print"What is your name?" 30 INPUT A$ 40 HELLO A$ 50 END 60 RUN
This is C++Code:#include <stdio.h> int main() { char name[15]; printf("Hello welcome to programming in C); printf("What is your name "); scanf("%s", &name); printf("Hello %s", name); getchar(); return 0; }
BASIC is very easy to learn, C and C++ take more time - pick what language suits yourCode:#include <iostream> #include <string> using namespace std; int main() { string name; cout << "Hello, welcome to Programming in C++" << endl; cout << "What is your name? "; cin >> name; cout << "Hello " << name << endl; cin.ignore(); getchar(); return 0; }
needs more
I hope that mistake in the C program was intentional.
And I don't mean the missing " either
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Is the mistake by any chance the getchar() ?
You used name without initialising it, scanf and printf are evil. I'm one of those people who know they are but not too sure why - someone else will fill it in. I'm sure.
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
I thought getchar(); needed some other include file.
No idea I never use it.
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
Ak, you coming on msn?
Code:#include <stdio.h> int main() { char name[15]; puts("Hello welcome to programming in C"); puts("What is your name ?"); fgets(name, 15, stdin); printf("Hello %s", name); getchar(); return 0; }
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
Code:#include <stdio.h> int main() { char name[15] = {0}; puts("Hello welcome to programming in C"); puts("What is your name ?"); fgets(name, 15, stdin); printf("Hello %s", name); getchar(); return 0; }
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
Code:#include <stdio.h> int main() { char name[15]; puts("Hello welcome to programming in C"); puts("What is your name ?"); fgets(name, 15, stdin); printf("Hello %s", name); getchar(); return 0; }
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
Let's just agree to disagree.
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry