Sunday, August 2, 2009

Which button do i press to compile a C++ code in Microsoft visual 2008?

I put it in Dev and it works no problem

Which button do i press to compile a C++ code in Microsoft visual 2008?
that depends on settings. when you're in the project go to the menu: Tools -%26gt; Options -%26gt; Select "Keyboard" there you have keyboard mapping schemes. (this answer is based on the VS2005, but i'll be surprised in 2008 have it in a different place).


Who can help me with my Obj-C Undo Manager?

Is anybody here a Cocoa dev? I need some help with an app I'm making in Xcode. In it there are


various "filters" that can be applied to a textarea. My problem is that, once a filter is executed, it can't be undone. To fix this problem, I added the following code before the filter takes place:





[[textArea undoManager] registerUndoWithTarget:textArea


selector:@selector(setString:)


object:[textArea string]];





This successfully added an undo, but when I test it there is no visable effect, and the textarea does not revert to the old text. I get no error log. Am I missing something? could somebody please help me out? Thanks.

Who can help me with my Obj-C Undo Manager?
You can search for a Cocoa developer at websites like http://getafreelnacer.com/


Harry had a z-score of 1.23 on a test that had a mean of 72 & a σ (standard dev.) of 13. Harry's raw score was

a. 102





b. 88





c. 78





d. 68





e. 52





or is it none of these

Harry had a z-score of 1.23 on a test that had a mean of 72 %26amp; a σ (standard dev.) of 13. Harry's raw score was
let z=z-score,


m=mean,


s=standard dev. ,


H=Harry's raw score





z=(H-m)/s


1.23=(H-72)/13


15.99=(H-72)


H=15.99+72


H=87.99


if you round it up, the answer will be 88





Therefore, Harry's raw score is a.88.


Having parse errors in a C program, help please.?

--------------------------------


typedef enum {now=10, next, last} grade;


typedef union {int age1; float age2;} age;





main()


{


struct {char name[20]; int age;} info;


strcpy(info.name, "name goes here");


grade now


info.age=15;


UNION age=info.age;


//parse error before 'union'





printf("This program is by %s, age %d. He is currently is grade %d." INFO.name, age.age2, grade);


} // parse error before 'info'


--------------------------------





There are probably other errors, but Dev isn't pointing them out. Any help would be appreciated. : )

Having parse errors in a C program, help please.?
1) You need a semicolon at the end of the line:


grade now





2) On the line:


UNION age=info.age;


I'm really not sure what you're trying to do here. Are you trying to create a variable, of type age, and set it's age1 variable to the value of info.age? Instead of that one line, you could try:





age myAge;


myAge.age1 = info.age;





And then in the line where you use printf(), instead of age.age2 you could type:





myAge.age1





3) In the line that begins:


printf("This





a) You refer to INFO.name, but there is no variable called INFO, only info. The C programming language is case sensitive.





b) You're missing a comma after:


is grade%d."





c) As the last parameter for printf(), you typed "grade", but grade is a type, now is the actual variable.





I hope this was helpful!
Reply:Missing a comma, I got the following to compile:





printf("This program is by %s, age %d. He is currently is grade %d.", false, false, false);
Reply:// The program below will compile and run


// and produce output.


// You have to think carefully about types,


// variables and variable assignments


// Plus a few minor typos.





// way to go!





#include %26lt;string.h%26gt;





typedef enum {now=10, next, last} grade;


typedef union {int age1; float age2;} age;





void main()


{


struct {


char name[20];


int age;


} info;





strcpy(info.name, "name goes here");





// grade is a type, myGrade a var of type grade.


// assign a value


grade myGrade = now; // semi missing





info.age=15;





// age is of type union { }


age myage; // union


myage.age1 = info.age; // assign





printf("This program is by %s, age %d. He is currently is grade %d.\n",


info.name, myage.age1, myGrade );


}

wedding reception flowers

Is there a good c++ compiler for Window ME?

Or will any of them do?





I wanted to download Bloodshed Dev, but they didnt have one listed for Window ME.

Is there a good c++ compiler for Window ME?
Dev-C++ uses MingW for a compiler. MingW works on ME as well. I'm not certain if Visual C++ Express 2005 works on ME. It should.





Seriously, upgrade from ME to XP or 2000 at least (or Vista for the latest OS). Aside from ME being a terrible OS, it is a bit limiting from a programmer's point of view. Many tools, Unicode libraries, etc. won't work on ME.


Strong rumor has c-webb coming to the mavs - - - good or bad?

http://chriswebber.com/dev/start.html





(his site)

Strong rumor has c-webb coming to the mavs - - - good or bad?
It's good in a way, He's better the DJ Mbgena or whatever. But CWebb isn't the type to win. How fitting for him to go to Dallas? Anyway Dallas needed a player like PJ Brown. Someone who good on defense with a jumper. CWebb has a jumper but can't play D. Dallas right now is the clown of all 50+ win teams. No one takes them seriously anymore. The only way for anyone to take the Mavs seriously is for them to win the championship.
Reply:the mavs arent trading right now, they've got a nba finals winning team.... too bad that the warriors are TOO GOOD FOR THEM
Reply:For the Mavs? BAD





C-Webb has been a loser everywhere he's been: the infamous TO to lose the NCAA title; running Don Nelson out of Golden State; choking to the Lakers when he was with the Kings; choking to Cleveland this past season.





Why would anyone want that karma on the team???
Reply:Nobody will EVER take the Mavs seriously again.





They could go 82-0 and nobody would fear them.
Reply:i dont think its a good move. they need someone who is actually going to play inside...you can count dirk almost a 3 man at this point because he is always on the outside. they need a true center. from where i dont know but they need one. josh howard will get even better this year and mature more. terry needs to trust his game and not let himself get wild when the team gets down by a few pts. they are a few steps away from a championship but they shouldnt get cwebb...bad move there
Reply:i think it's a good idea. i'll admit i used to really hate webber but he's always better than i thought even at an older age but he's a good passer, he's got good inside game, he can step out and hit the mid range shot and he's a guy that could play 15 minutes a game and rest dirk more.
Reply:he already signed to the mavs
Reply:Doesn't matter....C-webb sucks and is pretty much done. He was a King and I am a die-hard Lakers fan so will always go against him and his slow sorryass.





To quote the great Stephen A. Smith, C-Webb will give you the "softest 20 and 10 with 9-19 shooting". All he does is shoot elbow jumpers and they got Nowitzki to do that all day.





To sum up C-WEbb, he is loser in college, will retire a loser in the pros and will never be seen anywhere else once he retires. Once he called that infamous timeout to lose a game in Michigan, he should have just went to a trift shop and bought himself a rope and a ladder so he hang his career to death. GET UM!


Question in C++??? help soon?

i was searching in the internet i found a tutorial that uses "cstdlib.h" header file they said that it is available in all the compilers i tried on turbo 3.0 and dev cpp builder latest version it doesn't worked they said this header file cannot be found please help me.

Question in C++??? help soon?
you can use stdlib.h
Reply:I tried that, but it still gave me the same errors!


'There is no namespace std'


'Missing identifier: string'


That is not the exact wording, but that is what it meant. Report It

Reply:Prepended header files with 'c' indicate the standardized ruling for using


the C runtime library (standard portions) with C++. Thus time becomes


%26lt;ctime%26gt; instead of %26lt;time.h%26gt;, %26lt;stdio.h%26gt; becomes %26lt;cstdio%26gt;, %26lt;stdlib.h%26gt; becomes


%26lt;cstdlib%26gt;, etc.
Reply:May be that tutorial is wrong. If they said that every version of all compilers has that header, that should be "stdlib.h" not "cstdlib.h".


If is really true try to search on the net what header is actually
Reply:mmmmmmmmmmmmmmmmmm........ i need to review my C++ programming!


About C programming?

I want to use getpass, but I get a linker error in dev-cpp...Can anyone help me? I think I need an extra database...I'm using stdio.h, stdlib.h, string.h, conio.h

About C programming?
According to the man page, you'll need to include unistd.h

flowers gifts

C++ programming help?

I want to know how programs made using Dev's Bloodshed compiler can be made to work in windows. All of them open in MS-DOS. Can you tell me how to convert them to windows programs, so that they don't open in MS-DOS.10 pts. if ur method works. :-)

C++ programming help?
First, you need to realize that because you pick a different type of project in the new project dialog, the IDE / compiler isn't going to translate a console source file into a Win32 or Win32s API program. To see a bit of what is needed, try the URL below for a good, short tutorial on Win32 API programming. And by the way, while you can write the logical controls or event engine in C++ and have this work, the Win32 and Win32s APIs are actually written in C. This means you'll see some deviation between the code style, so expect it.
Reply:Nothing concerning C++ and your compiler.


There is a difference between *console* applications and GUI applications.


First are what you call "MS-DOS". If your app has as an entry point "main" function, in Windows it will be console app. (It has entry point, IIRC, crtMainStartup).


Second starts with WinMain() instead of main().


You need to read one of the first Charles Petzold books on Windows programming.
Reply:That is console, not necessarily MS-DOS, Microsoft would like you to think console programs are DOS types and hence old but that is not accurate, JDK tools (now Java SDK) work in consoles among other programs.





Main() and WinMain() is probably a Microsoft-specific distinction, in all other development platforms I can see there is no such distinction needed. A program is given a console access to begin with and when it is programmed to load and use GUI library it turns into a visual program with buttons and scrollbars and window and everything.





Another important point: you can not just reprogram that Bloodshed compiler to use those GUI widgets itself. Or the other way around, turning a GUI program into console program. That goes to any ready-made software package.


Can someone help me i tried to download c and c yuris revenge from a torrent but a cant run the game..?

i only get the files: deviance.nfo, dev-yuri dev-yuri.cue and yuris revenge keygen.


i really dont know what to do, if someone does please help me..thnks

Can someone help me i tried to download c and c yuris revenge from a torrent but a cant run the game..?
The .nfo is the readme open it with notepad by right clicking on it and going to open with and choosing notepad. It will probably tell you to mount the .cue with a program like daemon tools then run it with daemon tools and use the keygen to generate a cd-key.


To download daemon tools go to http://www.daemon-tools.cc/dtcc/download...


To use daemon tools after install right click on the red thunderbolt in your system tray go to emulation and click All options on then go to virtual cd/dvd rom then to device 0 then click mount image and click on the .cue





Make sure you read the .nfo though it will tell you any special instructions

daylily

Need help with with C++ and open gl?

i am useing dev cpp and i am just a begginer but i want to learn how to make graphics and animations cubes and all that good stuff and yea i know it takes time but i just need some help geting set up like how to i use open gl in dev cpp and stuff well please someone help me im desprate

Need help with with C++ and open gl?
Correct me if I'm wrong, but I think that DevCpp installs the GNU compilers. Anyway, you'll need to add AT LEAST these lines in every source file you want to use OpenGL with:





#include%26lt;windows.h%26gt;


#include%26lt;gl/gl.h%26gt;


#include%26lt;gl/glu.h%26gt;





These headers should be in the "include" folder of your compiler. Also, in the "lib" folder should be a "libopengl32.a" file (or someother similar).








For more advanced programs, you'll need to add some extensions and utilities that will ease your way through OpenGL:





#include “glee.h”


#include %26lt;gl\glu.h%26gt; // OpenGL Utilities


#include “glut.h” // Glut (Free-Glut on Windows)





Download FreeGlut here: http://prdownloads.sourceforge.net/freeg...





And Glee here:


http://elf-stone.com/getfile.php?title=G...


If the average speed of all drivers on route 80 is 71 mph, stand. dev. is 6 mph what percentage of drivers:?

a) 75 mph or greater


b) 55 mph or less


c) 80 mph or greater


d) between 60 and 67 mph

If the average speed of all drivers on route 80 is 71 mph, stand. dev. is 6 mph what percentage of drivers:?
The answers for this can be found using the z-table for standard normal distribution. using the formula z= (x-mu)/sigma, you can find the z-score which correlates to the probability underneath the curve. The answers are as follows:





a) .2525


b) .004


c) .067


d) .219


A question with probablity mass functions, cumulative distribution functions, mean, and st. dev.?

The question is as follows (I tried it on my own and had no idea where to start--our teacher taught us how to do it if the die is rolled once, but not 5 times):





Suppose you roll a die 5 times. Let X be the number of sixes that were rolled.


a) Write down the probability mass function (pmf) for X for all the values that X can take.


b) Write down the cumulative distribution function (cdf) for X.


c) Calculate the mean of X


d) Calculate the standard deviation of X.





Please break down how you got to the answer so that I can learn it...I learn best from examples and unfortunately our teacher didn't give us any.

A question with probablity mass functions, cumulative distribution functions, mean, and st. dev.?
Let X be the number of 6's in five rolls.





X has the binomial distribution with n = 5 trails and success probability p = 1/6 (for a fair die)





In general, if X has the binomial distribution with n trials and a success probability of p then


P[X = x] = n!/(x!(n-x)!) * p^x * (1-p)^(n-x)


for values of x = 0, 1, 2, ..., n


P[X = x] = 0 for any other value of x.





this is found by looking at the number of combination of x objects chosen from n objects and then a total of x success and n - x failures.





the mean of the binomial distribution is n * p


the variance of the binomial distribution is n * p * (1 - p)





--------------





the CDF is:





P(X ≤ x) =





x


ΣP(X = i)


i = 0





P(X ≤ 0) = P(X = 0) = 0.4018776


P(X ≤ 1) = P(X = 0) + P(X = 1) = 0.8037551


P(X ≤ 2) = 0.9645062


P(X ≤ 3) = 0.9966564


P(X ≤ 4) = 0.9998714


P(X ≤ 5) = 1





-------------------





the mean is n*p = 5 * 1/6 = 5/6





----------------





the standard deviation is the square root of the variance





variance = n* p * (1-p)


= 5 * 1/6 * 5/6 = 0.694444444





standard deviation is sqrt(5 * 1/6 * 5/6) = 0.8333333
Reply:a) You should have some equation in your book that handles the sum of two pmfs. The pmf for one roll of the douse (never say die!) is a uniform distribution over the integers [1,6]. Add two of those together ... then two more ... and one last roll, to total five. Or, if your equation is amenable to scaling, just apply the proper multiple of 5 in a critical spot (at this level of stats, my formulae didn't cover that).





b) Given that, the cdf is merely the sumulative sum of the pmf values.





c) %26amp; d) These formulae should also be in your text. The mean of the sum of distributions is the sum of the means. So, find the mean for one roll, and multiply by 5.


Similarly, the variance (standard deviation squared) of the sum of distributions is the sum of the variances. Find the variance for one roll, multiply by 5, and take the square root.


Problem in reading floating point numbers using Dev-cpp?

I'm having problem in reading some floating point numbers in C. When I use fstream and read say 4.56 - it stores it as 4.5599999999999.





I know from theory that 4.5599999... and 4.56 are equal but I need 4.56 not the one with infinite 9s.





So please help me. Is there a way I can read it as 4.56 or if not is there a function I can use to convert 4.5599999 to 4.56?

Problem in reading floating point numbers using Dev-cpp?
You can't help the input conversion -- decimal fractions don't always (all right, rarely) convert exactly to binary fractions, and the input conversion has to live with that. But you can control the output so that it looks tidier. Study the standard C output format conversions, the f conversion in particular, and limit the number of decimal places. %.2f in this case. That should produce the rounded result you're looking for.





Good luck.
Reply:My gut instinct is that it is a problem with your compiler. You may want to get a different compiler:





http://openlist.asponge.com/getInfo.php?...
Reply:to get clean output, you need to use the formatting specifications in your printf statement. For two digits after the decimal point, use %.2f





There is never a guarantee that internally floating point numbers will match exactly, even if math says that they should. Many times when a computer adds, subtracts, multiplies, or divides floating point numbers a little bit of error will creep in.


No matter how many bits it uses, the representation is always an approximation. In decimal notation, it takes an infinite number of digits to write the value 1/3. 0.3333 is an approximation. 0.333333333333333333 is better, but still an approximation. Since a floating point number is stored in binary, 0.2 is infinitely repeating like 1/3 in the decimal system.


Integers do not have this problem. You might try using an internal representation that multiplies everything by 100. then divide it just before you print it.

flamingo plant

10+ yrs in telecom engineer, want to change career to software dev .NET. Is MCAD certified enough for .NET job

I graduated years back as a CS Engineer with lot of courses (C++, Java) as software design background. Start career as a Telecom Engineer with moderate coding involvement, but gradually shifted to zero coding. I would like to get back to software development and possible change career to IT instead of staying in Telecom. I did started taking some Microsoft development courses, and will try to have MCAD/MSCD certification. I'm kinda wondering, just a certification without an IT experiences will be enough to land me a job in VB/C# .NET software development world?

10+ yrs in telecom engineer, want to change career to software dev .NET. Is MCAD certified enough for .NET job
Microsoft recommends that you have a certain period of experience in .NET before getting certified. However, you can get certified without the actual experience.





As for getting hired, that depends on the organisation and your level of knowledge.





I do not recommend that you take the last exam: Analysing requirements(I think its 70-300 as I recall ) before you work in development in a software company for at least 2 years. Stick with the MCAD for the time being.





Hope this helps
Reply:http://www.regilent.com/jobs.h...





Please forward to anyone you think might be interested.. Tnx.. For posting please view the site.. Tnx.. Report It

Reply:Its more than enough. Try to focus more on C# since thats the language of choice most companies are looking for in .NET these days.


Svn, Linux server, XP dev box have different dir structure, how can I make includes system ignorant?

I'm currently developing PHP applications on a Windows XP machine. I test everything locally (Apache 2 %26amp; php 5), but the live web server is linux (also Apache 2 %26amp; php 5).





The files I check out (subversion) use explicit paths (the standard here) that don't translate to my local windows box.





Is there a way to have PHP automatically translate lines like:


%26lt;?php require_once('/www/project1/file.php'); ?%26gt;


to work like:


%26lt;?php require_once('c:/projects/project1/file.... ?%26gt;


without having to manually change everything after each checkout and before each checkin?

Svn, Linux server, XP dev box have different dir structure, how can I make includes system ignorant?
Well, if you can differentiate what system you are running on (e.g. get the hostname or IP and use that to determine if you are in test or prod mode) then you can set paths %26amp; other system dependent data (passwords, logon ids etc).





A better possibility is to write a query to pull that information out of a local database so when your code is in prod it gets the production values and when it is in test it gets test values.





Yet another possibility is to put the values into a require file in the same directory with the code you are writing and import it. However, this may not work for you as it seems your standards do not allow you to say "require_once("./settings.php");"





I have worked on a variety of platforms in a variety of settings and this is always a problem. You try to minimize it but it is often one runs into the need for hardcoding in values that differ between test %26amp; prod.





Oh one more idea. Develop on Linux instead of Windows.


Open source dev operating system.?

Ok, so I have Mac OSX 10.4.11 running tiger. I want an open source operating system that will support mainly java, python, unix, C, and C++. Can I download GNOME for mac? It looks like just what I've been looking for.

Open source dev operating system.?
Gnome is just one of the GUI for Linux. Mac OS X already has a far superior GUI. Open source more refers to the licencing agreement of the software written then it does the operating system.





Basically you can write open source on Windows if you like doesnt matter and Mac OSX already supports the listed languages to my understanding.





The only reason people use Open Source Operating systems is when they have a specific need for an operating system to provide some function that they do not already at the kernel level. That is, you are able to modify the core of an operating system unlike Mac OSX or Windows OS.





Hope this has cleared up any misunderstandings you may have had to the purpose of Open source OS


Please Help me!!!!!!?

hi i got one assignment to make a game DEAL or NO DEAL For DEV C++ can any one help me to Give this Game Codes.

Please Help me!!!!!!?
Getting someone else to do your school work is a generally terrible idea.
Reply:May be you can contact a C++ expert at websites like http://askexpert.info/

umbrella plant

Gcc linux stray error?

Gcc stray error in linux..?


well, i made a program in dev C, since the codes are too long, i just copy and pasted it in linux gcc,when i compiled it, there are many stray errors, but all the errors are pointing out on the lines where i typed system("clear"); function, what can i do?





here's where one of the errors occur:





void compfirst()


{


int e=0;


system(“clear”);


printboard();


while(tracker1!=1)


{


compmove();


system(“clear”);


printboard();


e++;


if (tracker1==1)


{


return;


}


else if(e==5)


{


draws=1;


return;


}


playermove();


system(“clear”);


printboard();


} return 0;


when compiled, says stray eror,it is because i just pasted it?what will i do to correct it?do i need to remove the system clear functions? and make a different function?thanks

Gcc linux stray error?
Dunno. Clear works fine in Debian.





Seriously, more information is needed. What is the exact wording of the error messages, what include files do you list (the system command is correct however the only stray errors I know about or can reference are specific stray character messages: stray '/' etc). I understand that this is a pretty long program. I suggest you might ask in one of the C programming groups.


Is it easy to learn Html and php coding?

There are some books on html and dev C++ at my local library. Is it easy to learn?

Is it easy to learn Html and php coding?
Depends on the person. Programming takes patience and practice. Here is some help





for HTML





http://werbach.com/barebones





for PHP





http://www.php.net





Oh yes the best thing to run php on is apache web server. setting up the web server can be a little tricky but use search engines to set up either IIS or Apache web servers.





RJ


How can i void receiving the Run as window everytime i open any application?look the details?

everytime i try to open any application like notepad, Dev-c++,paint etc. i always get a small window with a title Run AS which gives me two option current user or the following user.


i have tried both of them for some of the application it opens when i am using the second option. but it is boring everytime i open application it asks me these option.


iany one knows how to stop the Run As window.

How can i void receiving the Run as window everytime i open any application?look the details?
Right-click on the icon...select properties...compatibility...and check run as administrator.





Cheers


Problem with a basic console code?

#include %26lt;iostream%26gt;


#include %26lt;stdlib.h%26gt;





int main(int argc, char *argv[])


{


cout %26lt;%26lt; "I pwn." %26lt;%26lt; endl;


system("PAUSE");


return 0;


}





i typed in this very simple code into dev C++ and it says 'cout' and 'endl' is undeclared. this is very basic and i dont know why it wont work

Problem with a basic console code?
You need to make the following changes.





#include %26lt;stdlib.h%26gt; --%26gt; #include %26lt;cstdlib%26gt;





Reason: Naming convention for standard library headers. All C library headers have a "c" for a prefix. And there is absolutely no ".h" in a standard header name.





cout %26lt;%26lt; "I pwn." %26lt;%26lt; endl; --%26gt; std::cout %26lt;%26lt; .... %26lt;%26lt; std::endl;





Reason: C++ standard library is in the std namespace. So you need to qualify everything in the namespace with std:: .
Reply:You are not defining your namespace. You need to include one of these:





using namespace std;





or





at the beginning of cout:





std::cout%26lt;%26lt;"I pwn...
Reply:Try this:





#include %26lt;iostream.h%26gt;


#include %26lt;stdlib.h%26gt;





void main()


{


cout %26lt;%26lt; "I pwn." %26lt;%26lt; endl;


system("PAUSE");





}





You need to stay consistent when including header files ".h"...also you can use void main() and lose the return since you technically don't need it.





But, if you want to keep it the way you had it just put the ".h" after your iostream
Reply:Add this line:





using namespace std;





after #include %26lt;stdlib.h%26gt; and before int main(...)





cout, endl, and the rest of the C++ standard library are declared inside a namespace called "std", which stands for "standard".





Namespaces are just for organizational purposes, not something you really have to worry about most of the time. Just include that line and you should be good to go.
Reply:A better solution is to add this after your includes:





using namespace std;

deliver flowers

Failed to set data for " ?

I have seen this error message in two programs that I often use, Dev-C++ and SUPER Video Converter. They don't seem to have much affect on anything, but I am wondering what they mean...I would hate for these programs to get more messed up in the future.

Failed to set data for " ?
Hey, I had the same problem with a program called SPSS except it was preventing me from using part of it. After changing it to "run as administrator" in properties-compatibility (right click on exe file) it works fine so it seems to be a vista security thing.
Reply:hey thanks man i am trying to use spss to and i had the same problem Report It



I have ADD and I want to start Socket PRogramming?

can someone hook me up with some links to a good compiler


that will work and a tutorial???








I can't find any that will actually work





DEV C++ I can't figure out

I have ADD and I want to start Socket PRogramming?
http://www.alhem.net/Sockets/tutorial/


How will I do this? >> Write a program that will accept char inputs then display the characters as a string.

NOTE: I am using Dev-C++ Compiler.

How will I do this? %26gt;%26gt; Write a program that will accept char inputs then display the characters as a string.
Are you trying to make a keylogger? Need more info to help you out here.





Besides, the basics of what your asking is covered in most books in chapters 1 or 2.


Disabling internet connection?

Does anybody know of a program or a way to create a keyboard shortcut to disable internet connection, even when I'm in other programs? If it is a program, I need one that does not require me to select it before I can disable my internet connection as I wish to disable my connection while in a full screen program and i do not wish to [alt]+[tab] out of it. For example, something that might disable my internet connection when I press a key in full screen mode of a game.


[Note] I have dev-C++, so if you know how to program something like that please give me the code so that i can copy and compile it into a .exe file.

Disabling internet connection?
Either


http://www.amleth.com/abhotkeys/


Or


http://www.keyboardexpress.com/features....





only way I know how
Reply:No, sorry. I think you will have to unplug the power cord to your DSL modem.
Reply:Put an administrator password on your computer and then open your firewall and block PORT 80 which is the port used for http. Another easy way is to assign a static IP to your computer and then block port 80 from the router. It's all up to you and your situation.

floral bouquets

Setw undeclared?

manipulator like setw and setprecision are stated as undeclared in Dev C++..why these happen? and how to fix these?

Setw undeclared?
I think you need to include iomanip.h first... like this...





#include %26lt;iomanip.h%26gt;





These kinds of errors just mean that you lack the required headers to include... (^^,)





http://ronaldborla.blogsome.com/
Reply:Have you included these files? If not this can cause that error.





#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





Also, omitting declarations like:


   using namespace std;


can cause errors too, although if you use the std:: format you can leave using declarations out sometimes.


DevShed says it can't find GNU Maker!?

Ok, I want to start to get going with Direct X programming and now Dev C++ is telling me it can't find GNU Maker! What am I supposed to do?

DevShed says it can't find GNU Maker!?
http://msdn2.microsoft.com/en-us/visualc...





(Install Visual C++ Express. C++ compiler that makes it very easy to work with DirectX.)





http://www.microsoft.com/downloads/detai...





(Install Platform SDK. Work with Windows applications.)





http://www.microsoft.com/downloads/detai...





(Install DirectX SDK. So you can write programs with DirectX.)





It sounds like you have no previous C++ programming experience. DirectX apps are just an application of C++. Consider learning C++ first, preferably from a good book, before going after DirectX.


Any ideas on how to get my compiler to run properly?

I'm running Dev-C++ and I started out with the infamous "Hello World" program.





#include %26lt;stdio.h%26gt;


int main()


{


printf("Hello World\n");


return 0;


}








It compiles just fine, but when I go to run it, the command prompt pops up for a split second and then disappears. Any clue as to why it's doing this, and how I can stop it?

Any ideas on how to get my compiler to run properly?
The window is closing because it ran your program, and your program finished and exited. There's nothing more to do.





Set a break point in your program in order to see what is happening.
Reply:I do not use Dev-C++, but:





1. If it is an IDE, there must be an option to keep console window open after the program has terminated, use that option


AND/OR


2. There are routines in C/C++ to wait for a key-press by the user (e.g., a getch() or a getchar() function or something like that), use that in your program before return 0; statement.
Reply:Rewrite like this





#include %26lt;stdio.h%26gt;


int main()


{


printf("Hello World\n");





int dumy = getc(); /* this will stall the program until you press a key */


return 0;


}


This statement seems to crash my program?

I tried my program and it crashed with the good old "send error to microsoft" style crash. I commented it all out and bit by bit introduced it back and this line seems to be the culprit, any ideas? (compiling on win xp with dev c++)





while ((i != table[j]) %26amp;%26amp; (table[j])){


j++;


}

This statement seems to crash my program?
Are you sure your not getting stuck in a never ending loop with j's value constantly rising?
Reply:I sounds like an unending loop. you have to first find out the value of i, see whether there is any equal value to i in the table[j], so the program can get out of the loop.
Reply:First thing to do is reverse the conditions in while, ie, put


(table[j])%26amp;%26amp;(i!=table[j])





But that may not be enough.


You need to make sure that you dont exceed the table array boundary.





First find the maximum number of elements(MAX_TABLE) possible in table array by looking at the declaration for it and then do soemthing like below


while( (j %26lt; MAX_TABLE) %26amp;%26amp; (table[j]) %26amp;%26amp; (i!=table[j]) )





Have Fun!!
Reply:I suspect you're running into a condition where table[j] doesn't exist. Try something like





while (table[j]) {


if (i != table[j]) j++;


}
Reply:what's the value of i? if the value of i never is equal to table[j] 's value it will loop forever (or until your PC crashes 8^)
Reply:Your stopping condition isn't taking into account that j may exceed the table size before this i != table[j]) %26amp;%26amp; (table[j]))becomes false.

dried flowers

I would like to learn Assembly... so...?

I would like to learn the Assembly programming language, so I want to know of what Assemblers you use and which one you think is best. :) I would like to be able to download the Assembler free on the internet... If you could give a link that would be great.





Then I think I will need a compiler? Links for those would be great too. :)





If there are any Assemblers that come with a compiler sort of like Dev-C++ I would rather have that than an Assembler and a different compiler.





And finally, if you know of any good Assembler tutorials on the internet, could you give me some links for those? Or books?





Thanks!

I would like to learn Assembly... so...?
Masm32 is probably the more popular one (for Windows), most available source code online seems to have been done it in. It comes with a decent simple IDE:


http://www.masm32.com/





I havn't messed with this stuff in a long time, but books I read always started out just using Debug. But I don't have any books handy I can recommend.





Assembler is cool to learn about, you'll learn a lot more about how your computer really works. It's really useless for most practical applications, however. Remember, it technically is not even a "programming language", but representative machine code.


Help me with an algorithm that takes a number and converts it into roman numeral?

hey guys i need help on how to make a program that reads an input number between 1000~3000 and gives you its roman numeral in the console. I have been really having trouble figuring out an algorithm for this and I need to do it for a class. If any of you have tips I'd greatly appreciate it.





(this is similar to what i have to make...


http://www.ivtech.com/roman/)


(also i use dev c++ 4)


(also ANY form of help is greatly appreciated)

Help me with an algorithm that takes a number and converts it into roman numeral?
Since you have a predefined range, you know the biggest roman numeral you will have to work with is M(1000), three times. I would start by determining the highest number roman numeral you will need.





Example: 2942


Does M(1000) fit?


- Yes


- How many times?


-Twice, print it twice


- subtract 1000 * number of times it fit from the number you are trying to make


- we now have 942


- Does C (500) fit?


- yes


- how many times?


- once, print C once





- No


- Does the next smaller one fit...I think that is C (500)








You can start to see a loop. Does my current roman numeral fit? Yes or No. If yes, how many times and subtract that from the number you are working with and print it that many times..., but there is a special case, when it would fit 4 times, then you need to print it once followed by the roman numeral one higher








if times_fit = 4


print("%c%c",curr_roman_numeral, prev_roman_numeral)


else


loop times_fit


print("%c", curr_roman_numeral)


end loop
Reply:try... www.1000projects.com


Binary flag problem? Windows XP?

This is a rather frustrating problem. I'm working on a Dell Inspiron 1100 laptop (though I'm sure that is of little consequence), running Windows XP sp2.





This problem started suddenly a few months ago and I have not been able to repair it since.





My programming IDE, Dev-C++, will not start. This is not an error with the program, as a fresh install will function perfectly everytime. Rather, when I restart my computer the previously functional binarys are invalidated in some way. A hex viewer tells me the data has not changed. If I uninstall the program, then reinstall, it functions as expected until I restart... then the problem starts anew.





This is a problem that I have seen before, but I do not have an easy solution to it. Any ideas, internet world?

Binary flag problem? Windows XP?
You most probably have a virus, since there should be no problem in restarting the computer, and you must have Norton Antivirus which doesn't stop any virus, it is really a really bad software.





You should uninstall your Norton and Install Bitdefender Full Edition 30 days trial, and make a full scan to your PC. This antivirus costs only about $30 USD the license and it is great.





http://www.bitdefender.com


What is the new syntax of "clrscr()"?

What is the new or the latest syntax of clrscr()? For example, when I use it in Dev-C++? Or according to Walter Savitch's Second Edition Book? Give as many as you can... thank you very much....

What is the new syntax of "clrscr()"?
Windows


system("cls");





Unix


system("clear");
Reply:Since clrscr(), which is part of conio.h, is a non-standard C or C++ function, you'll have to look up how Borland has it implemented. As I recall, it's nothing more than clrscr() by itself.

gift baskets

Assembly language tutorials?

i have a TI 84+SE and BASIC runs too slow for me, if you know of any good Assembly tutorials or programs, i cant figure out TASM or any of that, i do have Dev-C++ compiler, and i was wondering if that could compile Asm. lang., just using different headers. ive tried the "assembly language in 28 days!" and once more, got stuck at the assembly part. bassically im looking for a program more or less, but i would like the tutorial more, thanks ahead of time,

Assembly language tutorials?
I don't know if this will help you or not? Below is a link to lots of tutorials, some examples and tips on assembly programming. Problem is they are specific to PPC computers. You may or may not find some useful tutorials and information there.


Assembly language tutorials?

i have a TI 84+SE and BASIC runs too slow for me, if you know of any good Assembly tutorials or programs, i cant figure out TASM or any of that, i do have Dev-C++ compiler, and i was wondering if that could compile Asm. lang., just using different headers. ive tried the "assembly language in 28 days!" and once more, got stuck at the assembly part. bassically im looking for a program more or less, but i would like the tutorial more, thanks ahead of time,

Assembly language tutorials?
I don't know if this will help you or not? Below is a link to lots of tutorials, some examples and tips on assembly programming. Problem is they are specific to PPC computers. You may or may not find some useful tutorials and information there.


MinGW 3.1.0.1?

I just downloaded this program as an alternative to Dev-C++


I've installed but can't find the executable file in Command Prompt...how do i use it?

MinGW 3.1.0.1?
You probably will have to create an enviroment variable. Go to start %26gt;%26gt; settings %26gt;%26gt; control panel %26gt;%26gt; system %26gt;%26gt; advanced %26gt;%26gt; click on the button of enviroment variables %26gt;%26gt; Create a new variable for this compiler and place the full path for the exe file in it. After that restart your PC and test the command at command prompt.


I have written the following code for an online reservation sysstem but there is one error. Remove error pleas

When I run the code, there is just one error that I get. Please help me remove it. As this space is small to paste all the code although I tried. So I will be pasting the program in two questions. You can paste the correct code in a file and send it to me on my yahoo id digitaldocuments@yahoo.com. Funtion main is here and the other function is in the next question. Remember that I have to use Dev-C++ compiler version 4.9.9.2. The code is below and in the next questions:


______________________________________...


//Function main begins here.


void main()


{


int a=1;


int b=6;





cout %26lt;%26lt; "Output: (Y stands for YES and N stands for No)\n";


cout %26lt;%26lt; "\nWelcome to Airline Reservation System\n\n Menu for Reservation:\n\n ";





next_fun(a,b);


getche();


}


//The rest of the code is in the next question.

I have written the following code for an online reservation sysstem but there is one error. Remove error pleas
Friend this link can help you http://www.bobool.com/homes.php estavo with questions because he helped me hope that you also help

wedding

Wats wrong with this?

i'm using dev-c++ as my compiler and every time i try and compile this it tells me theirs no such file or directory 4 the header #include %26lt;sstream%26gt;.





// stringstreams


#include %26lt;iostream%26gt;


#include %26lt;string%26gt;


#include %26lt;sstream%26gt;


using namespace std;


int main()


{


string mystr;


float price=0;


int quantity=0;





cout%26lt;%26lt; "enter price: ";


getline (cin,mystr);


stringstream(mystr) %26gt;%26gt;price;


cout%26lt;%26lt;"enter quantity: ";


getline (cin,mystr);


stringstream(mystr) %26gt;%26gt; quantity;


cout%26lt;%26lt;"total price: "%26lt;%26lt;price*quantity%26lt;%26lt;end1;


system("PAUSE");


return 0;


}





wats wrong with it?

Wats wrong with this?
You don't have the sstream library in your header libraries folder. You need to obtain a copy of it and put it in with the rest of your header files.
Reply:idk cause i have no clue what it is
Reply:In my brain it makes absolutely no sense at all. sorry.
Reply:try downloading a copy of "sstream.h" maybe your version got messed up?
Reply:Make sure you have the newest version fo Dev-C++


Older versions of Dev-C++ do not have sstream
Reply:two many of these....%26lt;


My adobe reader scrolls down when I am scrolling down in another program, how do I change that?

I have this document in adobe reader and I have a program named Dev-C++. When I am scrolling down in that program my document in adobe reader is scrolling down, and that is pretty annoying. So how do i make my adobe reader not scroll down?


It is not scrolling when I use Firefox???

My adobe reader scrolls down when I am scrolling down in another program, how do I change that?
Search on internet.I'm sure you find it


GIMME CHEAPY LAPTOP!!! (lol)?

Does anybody know where I can buy a laptop for under $50 with these specs or higher:





Mac


-OR-


Windows 95


(Preferably Windows 95)





500 MHz





32 MB RAM





DirectX 7





Or basiclly anything that can run Blitz3D or Dev-C++


--------------------------------------...


www.demented-games.com

GIMME CHEAPY LAPTOP!!! (lol)?
Have you looked on Ebay or other auction site? such as http://auctions.yahoo.com/ or http:\\www.Overstock.com for a used laptop?





If you go to http://www.salescircular.com you might see some modern laptops are VERY good prices.





George
Reply:get win. xp pro
Reply:I would check out ebay or any local computer parts stores they have good deals


Help me with an algorithm please?

Help me with an algorithm that takes a number and converts it into roman numeral?





hey guys i need help on how to make a program that reads an input number between 1000~3000 and gives you its roman numeral in the console. I have been really having trouble figuring out an algorithm for this. If any of you have tips I'd greatly appreciate it. I know this is really not a math question, but i posted this question in programming %26amp; design and got no responses. My second best option was to post in math.





this is similar to what i have to make...





http://www.ivtech.com/roman/





(also, i use dev c++ 4)

Help me with an algorithm please?
One way would be to break the number down to its digits.





thousands, hundreds, tens, units





For thousands map as follows:


1 --%26gt; M


2 --%26gt; MM


3 --%26gt; MMM





For hundreds map as follows:


0 --%26gt; nothing


1 --%26gt; C


2 --%26gt; CC


3 --%26gt; CCC


4 --%26gt; CD


5 --%26gt; D


6 --%26gt; DC


7 --%26gt; DCC


8 --%26gt; DCCC


9 --%26gt; CM





Tens:


0 --%26gt; nothing


1 --%26gt; X


2 --%26gt; XX


3 --%26gt; XXX


4 --%26gt; XL


5 --%26gt; L


6 --%26gt; LX


7 --%26gt; LXX


8 --%26gt; LXXX


9 --%26gt; XC





Units:


0 --%26gt; nothing


1 --%26gt; I


2 --%26gt; II


3 --%26gt; III


4 --%26gt; IV


5 --%26gt; V


6 --%26gt; VI


7 --%26gt; VII


8 --%26gt; VIII


9 --%26gt; IX





That's rather inelegant. You could improve it by having an array of the roman numerals (IVXLCDM) and using some logic to generate each of these strings (rather than a big lookup).





Let's imagine you had an array of letters


aLetter[] = "IVXLCDM"





And you had a function that would take the following arguments:


nPlace (0 = units (10^0), 1 = tens (10^1), 2 = hundreds (10^2), 3 = thousdands (10^3).


nValue (0 to 9 representing that digit)





The nPlace value corresponds to an offset.





// Get the array offsets.


nOffset = 2*nPlace;





// The main logic would be something like the following pseudo-code


switch (nValue)


case 0,1,2,3:


// get aLetters[nOffset] and repeat it nValue times


// Generates I, II, III or X, XX, XXX or C, CC, CCC depending on the offset.


break;


case 4:


// get the characters at aLetters[nOffset] and aLetters[nOffset + 1]


// Generates IV, XC or CD


break;


case 5, 6, 7, 8:


// get aLetters[nOffset+1] and follow by


// aLetters[nOffset] repeated (nValue-5) times,


// Generates V, VI, VII, VIII or L, LX, LXX, LXXX or D, DC, DCC or DCCC


break;


case 9:


// get aLetters[nOffset] followed by aLetters[nOffset+2]


// Generates IX, XC or CM


break;
Reply:There are different ways you could do this. One algorithm that's somwhat short is something like:





- Input N


- Break this up into a 4-digit array from left to right, n[0], n[1], n[2], n[3] (where there are leading zeroes if necessary, so that n[0] = 0 if it's not a 4-digit number, etc.)


- Make another array called "numerals" with the values {"M", "D", "C", "L", "X", "V", "I"}


- Now loop through each digit as follows:





for i = 0 to n[0]


print "M"


next i





for i = 1 to 3


{


Let N = n[i]


If N = 1, print numeral[i+1] once


If N = 2, print numeral[i+1] twice


If N = 3, print numeral[i+1] thrice


If N = 4, print numeral[i+1] once followed by numeral[i]





For N between 5 and 10, repeat the above, only shift up to using numeral[i+2] and numeral[i+1]. You can use a modulus "%5" command to deal with this


}
Reply:Here is a complete working code (Pascal), You can easily convert to whatever algorithmic language You wish, I'll use . . . as placeholders, marking the indents, because Yahoo Answers trims all leading spaces from text lines.





function ArabicToRoman(Y:integer):string;





const Factors:array[1..3] of integer = (100, 10, 1);


const WholeRangeChars:array[1..3] of char = ('M', 'C', 'X');


const HalfRangeChars: array[1..3] of char = ('D', 'L', 'V');


const PrefixChars:array[1..3] of char = ('C', 'X', 'I');


var i:integer;





begin Y:=abs(Y); // no negative input values allowed


// but no need to be necessarily in 1000..3000 bounds


Result:=''; // null string


for i:=1 to 3 do begin


. . . while Y %26gt;= 10*Factors[i] do


. . . . . . . . begin Result:=Result + WholeRangeChars[i];


. . . . . . . . . . . . . decrement(Y, 10*Factors[i]) end;


. . . if Y %26gt;= 9*Factors[i] then


. . . . . begin Result:=Result + PrefixChars[i] + WholeRangeChars[i];


. . . . . . . . . . decrement(Y, 9*Factors[i]); end


. . . else if Y %26gt;= 5*Factors[i] then


. . . . . begin Result:=Result + HalfRangeChars[i];


. . . . . . . . . . decrement(Y, 5*Factors[i]); end


. . . else if Y %26gt;= 4*Factors[i] then


. . . . . begin Result:=Result + PrefixChars[i] + HalfRangeChars[i];


. . . . . . . . . . decrement(Y, 4*Factors[i]) end;


end; // for i


while Y %26gt;= 1 do begin Result:=Result + 'I'; decrement(Y) end;


end; // Arabic =%26gt; Roman
Reply:I am not going to get into the code specifics, but here is the logic I would use


First, count the digits of input; (limit 4 digits, being 3000)


add exclusions for range greater than 3000 and null entry





for 4 digits


{do this


go to 3 digit function


set great digits yes}





for 3 digits


{if hundreds-value=0 proceed to 2, else continue, do this, append to output if greater digits 'yes', proceed to 2 digits}





for 2 digits


if { tens-value=0 proceed to 1, else continue, do this function, append to output if greater digits 'yes', proceed to 1 digit}





for 1 digit


{ if units-value=0 print the buffer, else continue, do this function, append to output if greater digits 'yes', print result}





"do this function" (above) will basically be assigning a roman numeral as a result of a table lookup function


the reason for breaking it out is that the 4 digits will use M, MM, or MMM for their output, whilst 3digits will use CM, DCCC, DCC, DC, D, CD, CCC, CC, C for their function output, and 2digits would use ... etc etc you get the idea





Doing it backwards instead of forwards means you don't have to append blanks to the output





Hope this helps,


Good Luck

flowers on line

Hello World Os?

I decided to give building a os a shot so i downloaded bloodshot Dev C++ and i decided to google build a os so i went to this sigops one and i followed it through to the hello world os section:





http://www.acm.uiuc.edu/sigops/roll_your...





Can anyone tell me or show me the source code for this Os just so i can see how it is all pieced together! Plz and i dont want any answers like judging what you have said not for you i can dedcide if it is to tricky myself! Thanx

Hello World Os?
I'm not familiar with "bloodshot Dev C++", but the website you list says they use gcc, so I recommend using gcc. You can get gcc easily on Windows by downloading Cygwin (free!):





http://www.cygwin.com/





Then you can download their source code here:





http://www.acm.uiuc.edu/sigops/roll_your...





and follow their directions for building the OS. They tell you how to make a file that is a "boot floppy", which you can use with Virtual PC to boot your new OS.
Reply:Interesting query you have here, I also am interested in OS Development. My company Crimson Orbit Studios ( http://www.Dillxn.com ) is -for now- limited to game development, but are interested in expanding. I personally have never had the time to study up on single handedly making an os, but I do program in several languages and wondered if you wanted to team up with us. If you are interested, Please contact me via the website or at dillxn@dillxn.com


dillxn@yahoo.com


dillxn@hotmail.com


dillon.riecke@stu.daviess.kyschools.us


(I prefer the website)





Cheers man, and good luck!


-Dillon


How to become a professional gaming programmer?

I really want to be one when I grow up and I know how to code tic tac toe and pong on DEV-C++ and a lott more but I want to be a professional like the guys who make PS3 games and that stuff.

How to become a professional gaming programmer?
The best route into professional game programming is a Computer Science degree from a good college, preferably near a city with a lot of game studios. Going to school near an industry hub like Los Angeles, San Francisco, Seattle, Austin, etc, will make it a lot easier to find a job once you graduate. Don't waste your time with "game programming" schools or majors, they're more expensive and won't prepare you nearly as well as a normal CS degree will. Along with your CS classes you should also take two or three writing courses, and at least one art course -- these will help you communicate with your team mates later on.
Reply:Play more games like you are mad. You'll come up with your own ideas to create a cool game.





Specialise in game development or such courses from university. Publish your games on the Internet and show your potential employers that you can develop such cool games.
Reply:Here is some real good advice:





You need to be smart! Keep advancing your math skills and go to school for CS or even choose a gaming major. However, be weary of the gaming major. You have a lot more options with a degree in CS, one of those options being a gaming professional.


What the heII is wrong now? I can't seem to get this program to work, it keeps saying that the total is 0.00..

DEV C++





Program Name : NYS Product Tax





Can you help me please with my programming?





I asked another question similar to this one, and they helped me and I got it, but then I tried to ask for user input, to specify a spacific price amount, and now its giving me 0.00.





http://answers.yahoo.com/question/index;...





#include %26lt;cstdlib%26gt;


#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





using namespace std;





int main(int argc, char *argv[])


{














double Price; // Price Of Product


double tax=0.08123; // NYS Tax


double a=Price*tax; // Price Times Tax


double b=Price+a; // Price Pluss Total of Tax Times Price





cout %26lt;%26lt; "How Much Is This Product : ";


cin %26gt;%26gt; Price;





system ("pause");


system ("cls");





cout.setf(ios::fixed);


cout %26lt;%26lt; "The Total Price Of The Product, After Tax Will Be ";


cout %26lt;%26lt; setprecision(2) %26lt;%26lt; b;


cout %26lt;%26lt; endl;


cout %26lt;%26lt; endl;





system("pause");


system("cls");





}





It Keeps Saying 0.00

What the heII is wrong now? I can't seem to get this program to work, it keeps saying that the total is 0.00..
You have to ask for price before you compute tax :)





#include %26lt;cstdlib%26gt;


#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





using namespace std;





int main(int argc, char *argv[])


{





double Price; // Price Of Product





cout %26lt;%26lt; "How Much Is This Product : ";


cin %26gt;%26gt; Price;





double tax=0.08123; // NYS Tax


double a=Price*tax; // Price Times Tax


double b=Price+a; // Price Pluss Total of Tax Times Price











system ("pause");


system ("cls");





cout.setf(ios::fixed);


cout %26lt;%26lt; "The Total Price Of The Product, After Tax Will Be ";


cout %26lt;%26lt; setprecision(2) %26lt;%26lt; b;


cout %26lt;%26lt; endl;


cout %26lt;%26lt; endl;





system("pause");


system("cls");





}
Reply:And yet you pick as best answer the guy who blatantly stole my answer. Yes, I guess that doesn't make you a dummy. Guess what name I'm calling you instead? Report It

Reply:stole the answer from where? Any software developer would solve his problem... Report It



Gcc stray error in linux..?

well, i made a program in dev C, since the codes are too long, i just copy and pasted it in linux gcc,when i compiled it, there are many stray errors, but all the errors are pointing out on the lines where i typed system("clear"); function, what can i do?

Gcc stray error in linux..?
Post a snippet of the code and the accompanying error messages. From your description there is nothing wrong so closer inspection is required.


====================





Response to your update:





Pretty weird. It looks like when you pasted your code you got some weird characters. I pasted your code into my editor and every instance of the system call looks like this:





system(\u201cclear\u201d);





I would delete all the system call lines and retype them by hand. The rest of your function pasted ok.

florist shop

Linker error: "undefined reference to..." I don't know how to fix :(?

I am using dev c++ and getting a linker error. I understand what it means somewhat, but I do not know how to fix it. Here is my program:





#include %26lt;stdio.h%26gt;


#include %26lt;winsock2.h%26gt;


int main(int argc, char *argv[])


{ int starts, s; sockaddr_in sockin; WSAData *wsa;


if(WSAStartup(MAKEWORD(1,1),wsa))


return 1;


starts=socket(AF_INET,SOCK_STREAM,IPPROT...


sockin.sin_family=AF_INET;


sockin.sin_addr.s_addr = INADDR_ANY;


sockin.sin_port=htons(40254);


if(!bind(starts,(sockaddr *)%26amp;sockin,sizeof(struct sockaddr_in)))


return 2;


scanf("");


WSACleanup();


return 0;


}





i get undefined reference to: 'WSAStartup@8', socket@12, htons@4, bind@12, WSACleanup@0





I do not really understand how to link a .dll. Thanks for your help.

Linker error: "undefined reference to..." I don't know how to fix :(?
Link to wsock32.lib (regular windows) or ws2_32.lib (windows NT) using the Input\Additional Dependencies field on the Linker tab/folder of the project Properties.
Reply:I'm glad I could be, at least, a little bit helpful. Happy programming! Report It

Reply:I'm not familar with the above code, though the error seems to imply you're missing a linking library.





In Dev++, create a new project, delete main.cpp file created. From that point, right click on project, select add to project (you would add your own cpp file).





Linking. Right click on project, select project options. At that point it's a matter of using the built add object or library button to locate your missing linker file. Once found, click ok.