1,171 Posted Topics

Member Avatar for timb89

You forgot the end brace: [ICODE]if (s1.at(i) == s2.substr(s2.length()-i-1,1)[COLOR="Red"][B])[/B][/COLOR][/ICODE] >pretty sure my logic is right? No, I would have used [ICODE]if (s1.at(i) == s2[i])[/ICODE] instead of the above :)

Member Avatar for ArkM
0
108
Member Avatar for Aseem_Pandey

From [URL="http://www.daniweb.com/forums/thread110620.html"]this[/URL] thread I would suggest you to use: [ICODE][B]unsigned long long[/B][/ICODE] :) >can long long store 12 digit numbers. Depends on what your compiler is...

Member Avatar for siddhant3s
0
269
Member Avatar for vanalex

Write it as: [ICODE](n->d).day[/ICODE], the '[B].[/B]' operator precedes the arrow operator in expressions :)

Member Avatar for iJimJones
0
130
Member Avatar for horiya

To the OP: [LIST=1] [*]> // paste code here We aren't going to post free code for you, however we can help you to accomplish the more tricky parts, give us a thorough problem description (not just: My program doesn't work, can you fix it for me?) [*]We're not code …

Member Avatar for tux4life
0
133
Member Avatar for protjaart

>all is well but i do not have that "OTHER PROJECT TYPES " That's because you're probably using an Express Edition, there are no Setup and Deployment Projects in the Express Editions... >i beleive that windows vista could be part of the problem No, certainly not, Visual Studio 2008 was …

Member Avatar for protjaart
0
124
Member Avatar for Usura

Consider this: [CODE] char *pointers[2]; char array[2]; pointers[0] = &array[0]; [/CODE]

Member Avatar for tux4life
0
79
Member Avatar for Pavan_

Pavan, would you mind to post [URL="http://www.daniweb.com/forums/misc-explaincode.html"]using code tags[/URL]? >is negative subscript of array allowed in C? No, though you can achieve something like that by using pointer arithmetic, it can be very dangerous to do: [CODE] [COLOR="Red"][B]// This is completely wrong and very dangerous![/B] int array[20] = {0}; int …

Member Avatar for ArkM
0
148
Member Avatar for kasumi01

There's [B]a name conflict[/B] between the object 'movie' (which you created from your struct) and between your function movie: I corrected the code by changing the name 'movie' to 'movies' for every instance of DVD: [CODE] [COLOR="Green"]/* I've also changed your include directives */[/COLOR] [COLOR="Green"] #include <iostream> #include <string> #include …

Member Avatar for kasumi01
1
227
Member Avatar for mingke

[QUOTE=Pavan_;885494]At which line declaration and statement are mixing?[/QUOTE] [U]Describing the problem:[/U] Take a look at this: [CODE] [COLOR="Green"]int i,j; float H [100][100]; FILE*in;[/COLOR] [COLOR="Red"][B]in=fopen("0.txt","rt");[/B][/COLOR] [B]// you make an assignment here (1)[/B] FILE*out; out=fopen("rotation0.txt","w"); [/CODE] [B](1)[/B]: In C89 you aren't allowed to declare any more variables after the first statement (and …

Member Avatar for mingke
0
202
Member Avatar for happypig112

[QUOTE=csurfer;885568]Take input in an char array and ......[/QUOTE] To mention: a char array is not the only possibility, using a string is also possible :)

Member Avatar for tux4life
0
76
Member Avatar for Pavan_

[QUOTE=Pavan_;885522]if u are asked to implement a stack then what u prefer?[/QUOTE] I'd go for something like [URL="http://www.friedspace.com/cprogramming/stacks.php"]this[/URL] :) (a stack based on a linked list)

Member Avatar for Salem
0
106
Member Avatar for trickx0729

[QUOTE=trickx0729;884406]Hey guys, [INDENT]I just want to know if its possible to code a java program that will automatically logs you on your online accounts (e.g. such as yahoo mail, facebook, gmail, multiply, or even in this site) using your own username and password you use to register on such accounts. …

Member Avatar for PhiberOptik
0
668
Member Avatar for catchmrbharath

>try placing it directly in the video memory(0x40000000) Haha, directly! I assume the OP isn't using DOS anymore :P

Member Avatar for s_sridhar
0
152
Member Avatar for Steve00000

What do you actually want to achieve using an USB port? Your question was very vague... Do you want to write some files to a USB stick? Do you want to transfer data over a USB cable? Do you want to control a wireless USB adapter? USB has much applications …

Member Avatar for Dave Sinkula
0
142
Member Avatar for san gabriel

> Dear you are declaring a char ( char s1 = "" ). Its not a string fis=rst declare a string as > `char s1[10]; // string s1 of 10 characters` > `char s2[10]; //string s2 of 10 characters` > Now take input as > `cin.getline(s1,10,'\n');` > `cin.getlin(s2,10,'\n');` > Now …

Member Avatar for mirfan00
0
447
Member Avatar for swisschris104

[B] >Im New To c++, But Not New To Programming >What Iz The Point Of A Array? [/B] Haha! And you don't know the assets of an array? Imagine you're a teacher and you've to write a program which deals with the pupils' scores, let's say you've twenty pupils in …

Member Avatar for Narue
0
134
Member Avatar for hiscasio

[QUOTE=ArkM;880062]Better try to read this forum rules before 6th of June: [url]http://www.daniweb.com/forums/announcement8-2.html[/url][/QUOTE] Yes, and read [B][URL="http://www.daniweb.com/forums/misc-explaincode.html"]this[/URL][/B] as well :) And when you think you know the forum rules, you can come back, deal?

Member Avatar for hawash
0
149
Member Avatar for catchmrbharath

[ICODE]main()[/ICODE], this is not C++ ! In C++ it would look like: [ICODE]int main()[/ICODE] :)

Member Avatar for Sky Diploma
0
145
Member Avatar for rajboy

>Write a C++ program that ...... No, [B]YOU[/B] write it! BTW, [URL="http://www.daniweb.com/forums/thread78223.html"]Read this before posting[/URL] :)

Member Avatar for ithelp
0
100
Member Avatar for san gabriel

Hi, siddhant3s, I think it would be more helpful to the OP if you indent your code, there's a nice article about code indenting available [URL="http://www.gidnetwork.com/b-38.html"]here[/URL] :)

Member Avatar for siddhant3s
0
168
Member Avatar for Aggresive_Mind

>If You Want Something To Do Yes, I want to give you some links you should consider looking at before you start posting on this forum: [URL="http://www.daniweb.com/forums/thread78223.html"]Read this [B]before[/B] posting[/URL] [URL="http://www.daniweb.com/forums/announcement8-2.html"]Forum announcement I[/URL] [URL="http://www.daniweb.com/forums/announcement8-3.html"]Forum announcement II[/URL] Come back when you've read them :) (It will take you a couple of …

Member Avatar for Salem
0
138
Member Avatar for kaio-ken

First read [URL="http://www.daniweb.com/forums/thread78223.html"]this[/URL], then you read [URL="http://www.daniweb.com/forums/misc-explaincode.html"]this[/URL]. After that you change your code to use new-style headers, and then we're ready to help you :) Change [CODE] #include<iostream.h> #include<stdlib.h> [/CODE] to [CODE] #include<iostream> #include<cstdlib> [/CODE] (if your compiler supports it, if your compiler applies to the C++ standard, then this …

Member Avatar for pwl
0
124
Member Avatar for daino

IMO (= In my opinion) (yea killdude, it's an opinion) you shouldn't use WinAPI for Graphics Programming, it's unportable (as already said by siddhant3s), and there are a lot of better and easier to learn Graphic/GUI Libraries available for cross-platform development, if you write your program, making use of such …

Member Avatar for Prabakar
0
275
Member Avatar for p2009_d

[QUOTE=p2009_d;882459]Can u please tell me how to do nesting of arrays of structures[/QUOTE] What?? Edit:: Your (unformatted) code looks much more like C than like C++ !

Member Avatar for tux4life
0
103
Member Avatar for didi00

>Can someone help me to make a program in java Yes we can help you, please post the code you have so far ([URL="http://www.daniweb.com/forums/announcement8-3.html"][B]read this[/B][/URL]) and tell us where exactly you're having problems with.

Member Avatar for shantechi
0
161
Member Avatar for anydam

[QUOTE=anydam;877457]Not really, I am a beginner of C. could you tell me more about that?[/QUOTE] Take a look at [URL="http://publications.gbdirect.co.uk/c_book/chapter10/arguments_to_main.html"]this[/URL] web page :)

Member Avatar for jephthah
0
6K
Member Avatar for azjherben

[QUOTE=Ancient Dragon;879855]what is SDL ? [/QUOTE] SDL is a cross-platform multimedia library for C++. Take a look here: [URL="http://www.libsdl.org/"]http://www.libsdl.org/[/URL] :)

Member Avatar for azjherben
0
126
Member Avatar for fadia

>i dunnu how to do it which is change negative variables to positive ones?? I think you mean the 'absolute value', take a look at this: [CODE=C++] int a = -5; // a contains a negative value a = abs(a); // a now contains 5 instead of -5 [/CODE] >but …

Member Avatar for shindu
0
149
Member Avatar for DinMan

>Can sumone suggest me the easiest way to do it. I think [B]piping[/B] is the easiest way to do that :) ( No need for [ICODE][B]fopen()[/B][/ICODE] :P ) Note:: Not all platforms support piping, though as far as I know Windows, Linux and Unix are all supporting it... ( But …

Member Avatar for Aia
0
91
Member Avatar for seemant_sun

[ICODE][COLOR="Red"][B]void main()[/B][/COLOR][/ICODE] is evil, make it [ICODE][B][COLOR="Green"]int main()[/COLOR][/B][/ICODE] ([URL="http://www.gidnetwork.com/b-66.html"]read this[/URL]) [COLOR="Red"][B][ICODE]#include <conio.h>[/ICODE][/B][/COLOR] remember that conio isn't a part of the standard C library :) BTW, Why don't you use a [URL="http://www.cprogramming.com/tutorial/lesson5.html"]switch statement[/URL] for this? Edit:: To the OP: Do you want to pause your program? Then take a look at …

Member Avatar for William Hemsworth
0
382
Member Avatar for jdm
Member Avatar for vs.vaidyanathan

[QUOTE=vs.vaidyanathan;880859]What does error Lnk 2001 and LNK 1120 mean? Am a complete noob.. Could anyone please give me a step by step procedure to rectify it?[/QUOTE] How are we supposed to know this? We even don't know what compiler you're using :( (we need to know this because it can …

Member Avatar for vs.vaidyanathan
0
122
Member Avatar for bhagyaraj

Aaaaaaaaaaargh! [ICODE][B]void main()[/B][/ICODE], don't use it, [B]it's evil[/B] (check [B][URL="http://www.gidnetwork.com/b-66.html"]this[/URL][/B] page) !! Use [ICODE]int main()[/ICODE] instead :) You should also read [B][URL="http://www.gidnetwork.com/b-38.html"]this[/URL][/B]. A comment like this: [ICODE][B]//variable decl of float type[/B][/ICODE] makes no sense, everyone can see that the declared variables are of type float. [B][U]Note::[/U][/B] This code looks more …

Member Avatar for bhagyaraj
0
197
Member Avatar for Unhackmee

I get tired of saying it: why does anyone use [ICODE][COLOR="Red"][B]system("PAUSE");[/B][/COLOR][/ICODE] ?? Isn't [ICODE][B][COLOR="Green"]cin.get()[/COLOR][/B][/ICODE] good enough? Is it maybe too fast ?? BTW, Take a look at my signature as well! Edit:: And at [URL="http://www.gidnetwork.com/b-43.html"]this[/URL] :)

Member Avatar for William Hemsworth
0
97
Member Avatar for waldchr

>have recently upgraded from Allegro 4.2 to Allegro 5 Actually you aren't using Allegro 5 yet, you're using a Work-In-Progress (WIP) release for the future Allegro 5.0 branch :) So I don't know whether this Allegro is already finished yet, I personally think it isn't. >In Al 4.2 I could …

Member Avatar for waldchr
0
118
Member Avatar for gumber

> A simple voice chat program is just a program which sends sound over a network from one side to another side so I guess you'll probably need at least two things: >>> A network library >>> A library which deals with sound

Member Avatar for JustinJose12002
0
228
Member Avatar for apo

[COLOR="Red"][B]Unportable code alarm![/B][/COLOR] You're including [B]conio.h[/B], this isn't a standard library file iostream.h is not a C header, it's a C++ header, so you posted your code in the wrong forum Aaargh, the terrible [COLOR="Red"][B][ICODE]void main()[/ICODE][/B][/COLOR], it's evil, replace it with [COLOR="Green"][B][ICODE]int main()[/ICODE][/B][/COLOR] (read [B][URL="http://www.gidnetwork.com/b-66.html"]this[/URL][/B]). This is not C code, …

Member Avatar for tux4life
0
134
Member Avatar for fadia

Take a look at the corrected code and at Ahmed_I's post :) [CODE] #include <iostream> using namespace std; int main () { int faq_choice; [COLOR="Green"][B]char faq_YN;[/B][/COLOR] cout << "\t\t\t ================= "<<endl; cout << "\t\t\t || || || || "<<endl; cout << "\t\t\t || || || || "<<endl; cout << "\t\t\t …

Member Avatar for tux4life
0
201
Member Avatar for rtwister

Replace [ICODE]char password;[/ICODE] with [ICODE]char password[31]; [/ICODE] And change [ICODE]cin >> password;[/ICODE] to [ICODE]cin.getline(password, 30);[/ICODE] If you declare [B]password[/B] like [B]char password[/B] then you tell your compiler to reserve memory for one character only, but we want a set of characters (a string, an array of characters), so we write …

Member Avatar for tux4life
0
104
Member Avatar for kesh1000

First some remarks on the OP's code: Use new-style headers if possible, so: [CODE]#include <iostream.h> #include <stdlib.h> #include <fstream.h> [/CODE] would become [CODE] #include <iostream> #include <[B]c[/B]stdlib> #include <fstream> [/CODE] Avoid the use of [ICODE]system("pause");[/ICODE] (look in my signature, for a replacement and the reason on why to avoid it) …

Member Avatar for Ancient Dragon
0
104
Member Avatar for abhishek2301

[QUOTE=Tux Shakespeare] Apples are red, The sky is blue, If he posted using code tags I was happier too. [/QUOTE] :P

Member Avatar for ArkM
0
140
Member Avatar for Ameerah

Read all the names into a vector and use the [B][URL="http://www.cplusplus.com/reference/algorithm/sort/"]sort[/URL][/B] algorithm to sort them alphabetically :) You could also sort it by using the [B][URL="http://www.cplusplus.com/reference/clibrary/cstring/strcmp/"]strcmp[/URL][/B] function if vectors aren't allowed. If both of them aren't allowed then you'll have to implement a sorting function first (you could take a …

Member Avatar for ArkM
0
198
Member Avatar for rtwister

A password program which is only accepting passwords which consist out of one character is not a bad coding practice, but it's a bad security practice :)

Member Avatar for tux4life
0
135
Member Avatar for Behi Jon

>The compiler say "Link error" and ... And what? Could you please post the whole error message (plus code), and what's [B]Array[/B] ?

Member Avatar for Ancient Dragon
0
187
Member Avatar for bufospro

Took from the php manual: [QUOTE]Note: When sending mail, the mail must contain a From header. This can be set with the additional_headers parameter, or a default can be set in php.ini. Failing to do this will result in an error message similar to Warning: mail(): "sendmail_from" not set in …

Member Avatar for Josh Connerty
0
96
Member Avatar for sifah

[QUOTE=sifah;879543]i want to validate the String entered wether it is a valid standard equation of [COLOR="Green"]conics[/COLOR] the standard equation is: ax^2+by^2+2hxy+2gx+2fy+c=0 some variables can be missed in input string but it should be of "degree 2" equation[/QUOTE] Do you mean a quadratic equation like this: [B][ICODE]ax^2 + bx + c[/ICODE][/B] …

Member Avatar for JugglerDrummer
0
89
Member Avatar for thumizee

[QUOTE=mirfan00;879491]1) [COLOR="Red"][B]int arrA[];[/B][/COLOR] int *ptrToarrA = arrA; 2) [COLOR="Red"][B]int arrB[];[/B][/COLOR] int *ptrToarrB = arrB; Now it is correct. When you enter a value in the array it store in *ptrToarrB and if you want to enter more values in the array you run a for or while loop for this …

Member Avatar for tux4life
0
87
Member Avatar for DarthPJB

Create a vector of type [B]wchar_t[/B] and store the values in it :) Remember that you'll have to use [B]wcin[/B] and [B]wcout[/B] if you want to do I/O

Member Avatar for DarthPJB
0
237
Member Avatar for shaggy7576

I have no clue what you mean... Could you demonstrate the expected output using an example?

Member Avatar for tux4life
0
137
Member Avatar for Gewalop

It's probably better to make the following variables [B]private[/B] in your [B][ICODE]struct[/ICODE][/B] (as you have already input/output functions): [CODE] int ID; int salary; int division_code; int job_code; [/CODE] Every data member of a struct is made public by default, however you could use the data access specifiers to encapsulate some …

Member Avatar for mirfan00
0
148

The End.