STUPID QUESTION:
I'm using Bloodshed Dev C++ and i want to know waht that main.cpp is for and where i put other codes/scripts i want to put in the project..
I've never programmed in C or C++ so this is a n00by question.
STUPID QUESTION:
I'm using Bloodshed Dev C++ and i want to know waht that main.cpp is for and where i put other codes/scripts i want to put in the project..
I've never programmed in C or C++ so this is a n00by question.
File > New Project > Choose 'Empty Project'
From the Project bar on the left, right click the project name, and select add to project.
Also, calling yourself STUPID and a N00BY, doesn't make anyone more helpful.
Sent from my iPadŽ
main.cpp is the default source file that Dev-C++ generates for you when you create a new project.
You can create other source files and add them into the current project by going to Project | Add to Project.
when i create an empty project and add a code to it, it opens in DOS mode. How do i make it open on a Windows window.
You are creating a console application. Creating windows based application is not an easy task past what Dev-C++ offers as the initial template.
I suggest you learn C++ first by using only console applications.
Regardless, to create a windows based application, File->New->Project and choose the "Windows" named icon. Most probably to the left of the other icons
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
k so i'll create something on DOS mode (Console applications) first...
thanks for the helps
Creating DOS apps is a precursor to writing Windows (or Linux or Mac or Motorola phone, for that matter) programs. C++ is hard enough in DOS mode, so you should cover your basics well before moving on to advanced things.
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;}
Might want to read say, this thread, before Bubba jumps on you.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)