1,288 Posted Topics

Member Avatar for ranejitendra

Because you're using C linkage, you cannot create overloaded functions. There already is a function [B]CreateFile[/B], so you can't write another one. Rename your function [B]DLL int CreateFile(char *path)[/B].

Member Avatar for ranejitendra
0
4K
Member Avatar for abhiagro

Here is the first line of the function you actually wrote: [B]double enr(int no, int nc, double box, double x[][3], double c[][3])[/B] Here is what you thought you were trying to write, and what you're trying to call: [B]double enr(int, int, double, double, double);[/B] [B]double x[][3][/B] is [U]not[/U] the same …

Member Avatar for Schol-R-LEA
0
270
Member Avatar for fmasroor

If you don't like to see the warnings, you can do this (although there's no problem with seeing warnings - the code will still compile): [url]http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/cc2488bf-9100-46a6-a2e0-968e5d5707fc[/url] The error on the end is in your code: [B]main()[/B] should be [B]int main()[/B]

Member Avatar for Moschops
0
535
Member Avatar for jackmaverick1

[QUOTE]char* dest = "2"; strcat (dest,to);[/QUOTE] You're trying to write over memory that isn't yours to write over. See that "2"? All the memory next to it that you're trying to write over isn't yours. When you use strcat to concatenate two C-style strings, it is up to you to …

Member Avatar for Schol-R-LEA
0
351
Member Avatar for yye

[B] const unsigned char x[4] = {1, 2, 3, 4};[/B] [url]http://ideone.com/EHqa1[/url] This works fine. I note that you're putting int values into char types; is that deliberate?

Member Avatar for Moschops
0
349
Member Avatar for kingcong83

[QUOTE]"void main" is not and never has been valid C[/QUOTE] Actually, the ISO C spec allows [B]void main()[/B]

Member Avatar for Schol-R-LEA
0
157
Member Avatar for salah_saleh

Well then it sounds like you want to run a script, or some kind of batch file. If I were using bash as my shell, the file I made would look something like this: [CODE]#! /bin/bash ./run inputFile1 inputFile2 inputFile3 ./run inputFile4 [/CODE] and so on, and then I would …

Member Avatar for Fbody
0
446
Member Avatar for squ200

Get all y2 values. Find largest. Get all y1 values. Find smallest. Subtract smallest y1 from largest y2. That's the number you're looking for.

Member Avatar for Moschops
0
215
Member Avatar for fsefsef23

[B]void userInfo::setId(string anId) { id = anId;}[/B] What's id? Is that definitely a member of the userInfo class

Member Avatar for Moschops
0
167
Member Avatar for pendo826

You've tried to define the Weapon type twice, once as a class and once as a struct. Pick one; class or struct. Not both. Your code is full of comparisons where you've used = instead of == You've screwed up the braces in the function [B]void Player::attack[/B] You've made some …

Member Avatar for gusano79
1
784
Member Avatar for pendo826

You've screwed up your brackets and have some functions being defined within other functions. Fix brackets.

Member Avatar for Moschops
0
117
Member Avatar for nyuszi

You must [B]#include<string>[/B] to use the string class. C++ does not allow variable size array - you must make [B]maxn[/B] and [B]maxm[/B] const You must put a semi-colon on the end of [B]beolv("test.txt",n,m,x)[/B]

Member Avatar for nyuszi
0
260
Member Avatar for MrEARTHSHAcKER

Wait a minute, so you knew about [B]isdigit[/B] but you're too lazy to search for functions? If you're so lazy, why not use [B]isdigit[/B]?

Member Avatar for MrEARTHSHAcKER
0
209
Member Avatar for croussou

[QUOTE]I guess pointers are the most challenging part of C++, any help would be much appreciated.[/QUOTE] Pointers are fantastically simple and easy; they're just often badly taught using clumsy metaphors that do more harm than good. Anyway, here's some code that takes in as many names as you care to …

Member Avatar for croussou
0
245
Member Avatar for pendo826

[QUOTE] i dont understand were the wiz0-2.save[/QUOTE] That's not anywhere in your code.

Member Avatar for mikrosfoititis
0
134
Member Avatar for ayeshashahid

[B]marks[30];[/B] does not turn the [B]int[/B] marks into an array. If you want marks to be an array, make it one when you declare it.

Member Avatar for Moschops
0
148
Member Avatar for SureshAbraham

Please do not use Dev-C++. Here are some reasons why: [url]http://cplusplus.com/articles/36vU7k9E/[/url]

Member Avatar for Dakot
0
289
Member Avatar for rsashwin
Member Avatar for Dholcroft79

[B]srand[/B] does [U]not[/U] give you a random number. [B]srand[/B] is used to set the random number generator. Set it once, at the start of your programme, and after that when you want a random number use [B]rand[/B] [url]http://www.cplusplus.com/reference/clibrary/cstdlib/rand/[/url]

Member Avatar for Dholcroft79
0
213
Member Avatar for mc3330418

[QUOTE]What is the purpose of function with nothing in the parentheses? Like this something()[/QUOTE] To do something where you need to provide no more input. The most obvious is a [B]default constructor[/B]. Any time you create an instance of an object more advanced that the most basic of plain data, …

Member Avatar for WaltP
0
130
Member Avatar for Ich bin würdig

Have one controlling program that can start and kill the others with system calls such as fork() and execve().

Member Avatar for Smeagel13
0
97
Member Avatar for rjstamey

[B]while(y!=1||y!=2);[/B] Can you imagine any value of y for which at least one side of the OR isn't true? The answer is no - if y=1, then the right hand side is true, so the whole OR statement is true. If y=2, then the left hand side is true, so …

Member Avatar for rjstamey
0
106
Member Avatar for clorofaysal

The easiest way to do this would be to just carry the entire OS on USB and boot from it.

Member Avatar for cossay
0
142
Member Avatar for zhanrah

[B] return main();[/B] This makes no sense. It turns the program into a never-ending recursion that will eventually run out of stack and crash. Do not call [B]main()[/B] from within your program.

Member Avatar for Moschops
0
206
Member Avatar for fishsticks1907

As thines01 says, a better option is: [CODE]void account::deposit_checking(int n) { double a_20 = 20; if(n == 1) checking += a_20; }[/CODE] The rest of my post explains why your original version didn't work. [CODE]void account::deposit_checking(account d, int n) { double a_20 = 20; if(n == 1) d.checking += a_20; …

Member Avatar for thines01
0
192
Member Avatar for skylinedrifter

Once I added <cstdlib> to the #includes so you could use [B]exit[/B], seemed fine. [B]A Telephone Directory Enter first name: John Enter last name: Mark Found!! First Name: John Last Name: Mark Telephone Number8888888885 Do you want to look for another? n Good Bye...[/B]

Member Avatar for skylinedrifter
0
167
Member Avatar for Eldyvoon

Use as normal, and just ignore the data you don't want to use. [CODE]ifstream someStream("file.data"); std::string dataInput; someStream >> dataInput; someStream >> dataInput; someStream >> dataInput; // Now use this one[/CODE] Loops etc can do the heavy lifting.

Member Avatar for Eldyvoon
0
270
Member Avatar for ankit.4aug
Member Avatar for az.rathore

[QUOTE] is sorted in ascending order[/QUOTE] [CODE]for(int i=1;i<sizeOfArray;++i) { if (array[i]>array[i-1]) { //Looking good... } else { std::cout << "Not sorted :("; break; } }[/CODE] [QUOTE]from even to odd number or not ?[/QUOTE] I have no idea what you mean by this.

Member Avatar for WaltP
0
1K
Member Avatar for sunder6218

Are you able to sample the mouse position periodically, creating a record of its location in a co-ordinate notation of some kind? That's how to start.

Member Avatar for Moschops
0
115
Member Avatar for amras123

In the [B]for[/B] loop you set a=1, but you don't in the [B]while[/B] loop.

Member Avatar for WaltP
0
101
Member Avatar for maria536

You appear to be writing your code in Visual Basic, but then you're trying to compile is as if it were C++. They're two different languages - a C++ compiler will not be able to turn your Visual Basic code into a program.

Member Avatar for Moschops
0
193
Member Avatar for Aghtar

I'm talking here just about your second program. [CODE]PoolSize(float Length, float Width, float Depth, float volume, const float cubicfeet=7.48051948);[/CODE] This is not how you call a function. You don't specify what kind of object they are when you call it. Just the name. Try [CODE]PoolSize( Length, Width, Depth, volume, cubicfeet);[/CODE] …

Member Avatar for Moschops
0
125
Member Avatar for kodemaaster

Build your code with debug symbols in. Run it again in gdb, and when the segFault happens, enter [B]up[/B] until you're in one of your lines of code. Enter [B]print variableName[/B] for each variable in that line of code until you find the bad one. Almost certainly, one of your …

Member Avatar for raptr_dflo
0
2K
Member Avatar for negin1234

If you mean files (a file system is something quite different), this is dependent on your operating system and the libraries/API that you've got access to. What operating system are you using?

Member Avatar for raptr_dflo
0
93
Member Avatar for akde

[QUOTE]I have already tried to add (int *) to the beginning of the codes but didn't work.[/QUOTE] Explicit conversion is what's required and should work. Show us how you did that.

Member Avatar for akde
0
263
Member Avatar for james6754

[B]I have deleted pInt[/B] This means "I have told the operating system that I don't care what it does with the memory pInt is pointing to". That's all it means. pInt still exists, pInt still contains the same memory address, and frequently that memory will contain the exact same values, …

Member Avatar for Moschops
0
124
Member Avatar for jmaass20

You're missing a [B];[/B] at the end of that. See each one of those function? This list: [B]BankAccount(); BankAccount(string,double,string); string getID(); double getBalance(); void setID(string); void setPassword(string); bool deposit(double); bool withdrawal(double); void addInterest(); bool equals(BankAccount); string getPassword();[/B] You need to make each one of those. I'll get you started, and …

Member Avatar for Lerner
0
137
Member Avatar for avgvstvs

The find_last_of function takes more than one parameter. You're trying to feed it just one parameter. Here are the find_last_of functions. Pick one. [url]http://www.cplusplus.com/reference/string/string/find_last_of/[/url]

Member Avatar for avgvstvs
0
1K
Member Avatar for DeusManP0W

[QUOTE]char experiment = 'Q' is what I got, however if I were to type in "AAA" or simply more letters than one then it[/QUOTE] experiment in your example above is a single char. Is it any wonder that trying to put more than one char into it causes problems? There …

Member Avatar for DeusManP0W
0
213
Member Avatar for kkreisler

You set the value of x to zero at the start of your loop, and your loop will end when x does not equal zero. Given that you don't change the value of x, when do you expect the loop to stop? (Never) Have you mixed up the variable [B]value[/B] …

Member Avatar for kkreisler
0
150
Member Avatar for jdh1231
Member Avatar for dragon_chick

A class is a kind of object. You create one, and then use it. Like this, for example: [CODE]int x; // make an object of kind int, named x char y; // make an object of kind char, named y String z; // make an object of kind String, named …

Member Avatar for Moschops
0
304
Member Avatar for collinskawere

The question is actually why [I]wouldn't[/I] your programmes disappear when they're finished? What are you doing to keep them visible? Nothing. Your programme is a console programme; when you run it, a console is brought into existence. When the programme finishes, the console closes. If you open a console yourself …

Member Avatar for siskaj
0
141
Member Avatar for senergy
Member Avatar for C++newbie chick

Are you forced to use an array? This would all be much easier if you used a proper C++ container type such as vector.

Member Avatar for raptr_dflo
0
250
Member Avatar for C++newbie chick

Your deletion mechanism essentially writes over location i with location i+1. What happens when you get to the highest member of your array? [B]stdRec[i].studentID = stdRec[i+1].studentID;[/B] If [B]i[/B] is the last member of the array, you are then trying to read [B]i+1[/B] - this is not your memory to read. …

Member Avatar for chandara
0
859
Member Avatar for 3FatCats

You are calculating one int divided by another. In C++, dividing one int by another will return an int. So, for example, 5/2 = 2, and 3/4 = 0. If you want the output to not be an integer, don't divide one integer by another. One way to achieve this …

Member Avatar for 3FatCats
0
244
Member Avatar for BoBok2002

I suspect you're creating the stack using the wrong syntax. May we see the line of code in which you try to create the stack?

Member Avatar for BoBok2002
0
388
Member Avatar for carolinatech

Work out how many quarters are in the amount of change. Display number of quarters. Subtract (0.25 * number of quarters) from amount of change. Repeat for dimes. Repeat for nickels. Repeat for pennies.

Member Avatar for Stazloz
0
129

The End.