1,288 Posted Topics

Member Avatar for nathan.pavlovsky

https://developer.apple.com/library/ios/recipes/xcode_help-structure_navigator/articles/Adding_an_Existing_File_or_Folder.html

Member Avatar for nathan.pavlovsky
0
470
Member Avatar for amithunter

Yes. You'll find it easier to use a library than to do it all yourself. There are some listed here: http://en.cppreference.com/w/cpp/links/libs There are many more out there.

Member Avatar for rubberman
0
208
Member Avatar for Jjajangmyeon
Member Avatar for aluhnev

Our very own Viking Mike has an answer (with a nice flow chart) on this stackoverflow page: http://stackoverflow.com/questions/471432/in-which-scenario-do-i-use-a-particular-stl-container

Member Avatar for mike_2000_17
0
278
Member Avatar for TommyTee

int Nmbr; int Bal; char Stat; cin >> Nmbr; cin >> Bal; cin >> Stat; Account Nmbr; This code seems to attempt to create an int named Nmbr and also an Account named Nmbr. This makes no sense. You cannot give two different objects the exact same name. Are you …

Member Avatar for David W
0
2K
Member Avatar for SoreComet

str1 is effectively a pointer. A pointer is a memory address. In this case, it's the memory address of the first char in the array of char created on line 5. str2 is effectively a pointer. A pointer is a memory address. In this case, it's the memory address of …

Member Avatar for SoreComet
0
123
Member Avatar for Yahia Farghaly

Jeff Prosise wrote a couple of good ones back in the mid-nineties. They're very good for understanding MFC.

Member Avatar for Moschops
0
746
Member Avatar for jameslyle2

` if (number) { // Check if the input is a number. ` This does not check that the input is a number. Not only because at this point there has been no input, but also because it will attempt to turn `number` into a bool and test it for …

Member Avatar for Gonbe
0
232
Member Avatar for cambalinho

Most of your errors involves trying to use member variables but not stating which object they're from. For example: friend ostream& operator<<(ostream& os, const property& dt) { if(getf==NULL && setf==NULL) //error these don't make sence to me :( os << dt.PropertyValue; else if (getf!=NULL) os << getf(); else return 0; …

Member Avatar for cambalinho
0
402
Member Avatar for Jjajangmyeon

As a rule of thumb, every textbook won't cover every member function in the C++ standard library (not least because it's huge). For that sort of thing, look at a dedicated reference, such as: http://en.cppreference.com/w/cpp/string/basic_string There's `find`, towards the bottom. It's completely standard and there's nothing wrong with it. If …

Member Avatar for rubberman
0
342
Member Avatar for BibhutiAlmighty

It may be easier to use one of the many common widget libraries; some of them have very simple interfaces for playing sound, and the library takes care of the heavy lifting involved in interfacing with your operating system.

Member Avatar for Moschops
0
195
Member Avatar for JOHN-shirley

` Dictionary *dict = create_dictionary ;` Did you mean ` Dictionary *dict = create_dictionary();` ?

Member Avatar for Moschops
0
82
Member Avatar for Vandithar
Member Avatar for maha harshini
0
407
Member Avatar for Sarkurd

They're used by the preprocessor to replace things in your code with other things (including replacing things with blank space - effectively just removing them). http://www.cplusplus.com/doc/tutorial/preprocessor/ assert() is a function. http://www.cplusplus.com/reference/cassert/assert/ NDEBUG is a macro that may or may not be `#define`d somewhere. If your code contains: `#define NDEBUG` the …

Member Avatar for Sarkurd
0
177
Member Avatar for nhrnjic6

**.h file** Missing semi-colon at end of line 20 **impl file** Remove semi-colon from end of line 6 Operator is wrong on line 12 (>=) Missing semi-colon on line 14 Does the function getElement return something or not? If it does, its return type should not be void. If it …

Member Avatar for nhrnjic6
0
302
Member Avatar for xcenax
Member Avatar for yazici.batuhan

So what's the problem? It makes no sense to say that you can do it easily using a class but not like this. The functions in your class would be almost identical. If you've done it with a class, you're almost done. Leave every member variable in the class, change …

Member Avatar for Moschops
0
324
Member Avatar for Nima_1
Member Avatar for surfingturtle

Perhaps this rewrite makes it clearer. Braces make code easier to read. void acceptCharacter() { cout<<"Enter a character: "; cin>>inp; if(inp>='A') //ASCII value of A = 65 { if(intp<='Z') //ASCII value of Z = 90 { cout<<endl<<"Uppercase"; } else if (inp>='a') //ASCII value of a = 97 { if(inp<='z') //ASCII …

Member Avatar for surfingturtle
0
322
Member Avatar for messr135

This being C++, you might consider using a container that does deduplication for you. A std::set comes to mind. If you use a std::set of strings to store your strings in, instead of an array of strings, when you're done adding your strings to it, there are no duplicates.

Member Avatar for David W
0
414
Member Avatar for oanahmed

> I'm unable to figure out the actual dimension of the array and its lenght as the variable size is only declared not defined; meaning it has not been assigned any value yet. It still has a value; just not one assigned by you. The `int` named "size" occupies some …

Member Avatar for oanahmed
0
349
Member Avatar for Huy_2

A pointer is just another kind of variable, used for holding another kind of information and you can perform operations on that information. There's no reason to think of it differently to how you think about an int, or a double, or a float, or anything else. Why is an …

Member Avatar for Moschops
0
184
Member Avatar for Jjajangmyeon

A reference is another name for some variable; when you use the reference, you're using that exact same other variable. A reference is an alias, if you like. `int &length;` In this case, what other variable is "length" another name for? None. It makes no sense. `int &length = 0;` …

Member Avatar for Jjajangmyeon
0
6K
Member Avatar for nathan.pavlovsky

` HardwareRecord temp;` It doesn't know which constructor you mean to use to make this object. The default one (`HardwareRecord::HardwareRecord()`), or the one that takes four parameters that all have default values. Looks like the easiest fix is to remove the default constructor.

Member Avatar for nathan.pavlovsky
0
20K
Member Avatar for yaldoo

While there is nothign at all wrong with doing the heavy lifting yourself, C++ comes with a nice standard library; if you read all the numbers from both files, and as you read them insert them into a std::set, when you're finished reading, the set is ordered and contains no …

Member Avatar for yaldoo
0
6K
Member Avatar for anar.bataa

What about it don't you understand? It's quite simple. Client sends username and password to server, server checks it matches the record. You can make it more fancy by having the password records hashed and salted for security, and have what the user sends encrypted to thwart eavesdroppers, but there's …

Member Avatar for anar.bataa
0
548
Member Avatar for annonah

Does an instance of the class have to be exactly ten bytes always, or do you actually just need to make an int class that can handle 2^80 possible values (i.e. 10 bytes' worth of values)?

Member Avatar for Hiroshe
0
213
Member Avatar for Auroch

`What should I search for in my code in order to find the problem?` You should look at the line number that the error messages tell you and use that to identify the line in the code that it doesn't like. You're declaring the same variable, w, in more than …

Member Avatar for Auroch
0
985
Member Avatar for ashesh1708

It's not enough to just include a header. You have included a header, which tells the compiler enough basic facts about the function named `CkFtp2::put_Username` to know what its name is, what input parameters it takes, and what return it gives. The compiler has enough information to essentially put a …

Member Avatar for Moschops
0
444
Member Avatar for Auroch

First, you're doing yourself no favours by using a compiler from twenty years ago. C++ has moved on a long way since then, and you'd be much better using a recent compiler. Anyway, you're trying to create a Vector2D object using this function: `Vector2D a(a1, b1);` This is a constructor …

Member Avatar for Auroch
0
247
Member Avatar for aanchal_1

Try ` t[i] = teacher(name,code,sub,pub);` and similarly for others. While I'm here, you've got variable length arrays, which are illegal in C++ and your compiler really shouldn't let you have that, and you're using char arrays where proper string objects would be better and easier.

Member Avatar for aanchal_1
0
281
Member Avatar for can-mohan

You're trying to use a constructor that doesn't exist `Point2D(int,int);` I'd guess you meant to write something like: Point2D::Point2D (int xVal, int yVal): x(xVal), y(yVal) {}

Member Avatar for Moschops
0
263
Member Avatar for Davincie

for (int i = 0; i<1; ++i) { cout << "3" << endl << "6 6" << endl << "9 9 9" << endl; }

Member Avatar for Avishek_1
0
157
Member Avatar for DeneyimszDenek
Member Avatar for DeneyimszDenek
0
121
Member Avatar for nickliutw

`strList[a]` is a char\* that you never set. It could be pointing anywhere in memory. It will almost certainly be pointing at memory that the operating system doesn't want this program touching, so it kills it with a segFault.

Member Avatar for iamthwee
0
158
Member Avatar for mizShaid

Files: http://www.cplusplus.com/doc/tutorial/files/ Sort: http://www.cplusplus.com/reference/algorithm/sort/ Displaying: http://www.cplusplus.com/doc/tutorial/basic_io/

Member Avatar for Moschops
0
62
Member Avatar for Auroch

While we're here, I see that you're comfortable using C++ string objects in your code. Why use a char array for `str` rather than a C++ string?

Member Avatar for Auroch
0
260
Member Avatar for Mr.UNOwen

An array is guaranteed to use contiguous memory (i.e. no gaps between the elements). A struct has no such guarantee; the compiler can choose to put padding between the members for ease of memory access. https://en.wikipedia.org/wiki/Data_structure_alignment#Typical_alignment_of_C_structs_on_x86 As it happens, typically a float is the right size for memory alignment and …

Member Avatar for Mr.UNOwen
0
180
Member Avatar for Auroch

I'm making the assumption here that your actual command line is "project1.exe test.dat", and that project1.exe is the executable made from the code above, and that the file "test.dat" contains the text "cat dog cat dog". Your code (whilst using a compiler from two decades ago - iostream.h and other …

Member Avatar for Auroch
0
463
Member Avatar for sankubha

The short answer is yes. The longer answer is if you're doing GUI programming, I recommend you use a decent cross-platform GUI library such as QT, which is heaving with functions to do things like showing windows and reading text from them.

Member Avatar for Ancient Dragon
0
462
Member Avatar for jkhippie

`i` is not a number. It's an iterator. Either cycle over the deque using numbers: for (int i =0; i< SpriteList.size(); ++i) { SpriteList[i] ... ... } or dereference the iterator to get at its contents: for( auto i = SpriteList.begin(), end = SpriteList.end(); i != end; i++ ) { …

Member Avatar for jkhippie
0
2K
Member Avatar for Himanshu Chawla

Is that ab^(4c^2-d/m-n) or ab^4c^(2-d/m-n) or ab^(4c^2)-d/m-n or ... or .. or ... or ... There are a billion ways to interpret that.

Member Avatar for iamthwee
0
241
Member Avatar for morqan.leo

Well done, although this sort of thing is usually done over in the "Introductions" forum, over here: http://www.daniweb.com/community-center/community-introductions/165 :)

Member Avatar for Moschops
0
55
Member Avatar for bejfake

You're right; this is going to cost you some time. It's always worth using some profiling tool to double-check where the time is being taken in your code (it is very, very common for people to think they know, and to spend a lot of effort optimising their code how …

Member Avatar for rubberman
0
1K
Member Avatar for dawibob

This is very dependent on your operating system's console. What operating system are you using?

Member Avatar for dawibob
0
139
Member Avatar for basil60

Inside a function, the following variables exist: 1) Parameters you passed in 2) Any variables you create inside that function. 3) Any global variables that exist everywhere. `ranum` is none of these, so it does not exist inside the function `loop`.

Member Avatar for richieking
0
2K
Member Avatar for TheFearful

` stackArray = new int[stackSize];` should go in your constructor so it's done only once, when you create the stack. At the moment, you're recreating the stackArray every time you push something. Your question is awfully vague. What in particular are you struggling with?

Member Avatar for TheFearful
0
217
Member Avatar for Rushin1992
Member Avatar for Assembly Guy
0
104
Member Avatar for PulsarScript

This is your code. int count = 0; do { for( int i = 0; i < 4; i++ ) { count++; } cout << count << ‘ ‘; } while ( count < 10 ); What's not clear about this?

Member Avatar for PulsarScript
0
199
Member Avatar for shehata07

> what is wrong ?? `#include <iostream.h>` Back in 1998, the C++ standard came in and iostream.h definitely went out. If your compiler accepts this, throw it away and get one from this century. `#include <conio.h>` This is non-standard in so many ways, and many C++ compiler installations don't have …

Member Avatar for shehata07
0
327

The End.