49,761 Topics

Member Avatar for
Member Avatar for Duki

Can someone [B]please[/B] provide some insight on this: [code=c++] int get_smtp_line( void ) { char ch = '.'; char in_data [255]; char * index; int retval = 0; index = in_data; while (ch != '\n') { if ( (retval = gensock_getchar (SMTPSock, 0, &ch) ) ) { gensock_error ("gensock_getchar", retval); …

Member Avatar for Duki
0
125
Member Avatar for karen_CSE

Hi, I have a big project (#1). this is its direction: Project I Software for a Bank Write a C++ program for the following task: a) Should allow 5 users with user name & password [ (Ohlone1, Ohlone1pw), (Ohlone2, Ohlone2pw),( Ohlone3, Ohlone3pw), (Ohlone4, Ohlone4pw), (Ohlone5, Ohlone5pw)] b) Display a welcome …

Member Avatar for hammadk
-1
2K
Member Avatar for MasterGberry

Ok, I have asked this b4, and I don't think I have gotten a straight forward answer, I really need this answered, because what I am doing is "legal", but i am 100% it does not make logical sense. This it the original C# code [CODE] var version = reader.ReadUInt32(); …

Member Avatar for MasterGberry
0
1K
Member Avatar for Fouly

Hi all, I'd like to open a file dialog using win32 project ...I need a simple code example that uses FileOpen...I used <commdlg.h> ...::GetOpenFileName or ::GetSaveFileName but i can't get them to work :S ... Thanks in Advance,

Member Avatar for Quatrus
0
13K
Member Avatar for Crutoy

Hi another exercise which im having problems with. In this challenge im given a four digit integer and encrypt each digit as follows. Replace each digit by the sum of that digit plus seven mod 10. Then swap 1st and 3rd digit places and 2nd with 4th. Heres what i …

Member Avatar for Crutoy
0
87
Member Avatar for mIXpRo

hii, this is my .h ,file : [CODE] /* * sortedlist.h * * Created on: Jan 16, 2011 * Author: saeed hardan */ #ifndef SORTEDLIST_H_ #define SORTEDLIST_H_ #include <iostream> #include <functional> namespace mtm { template< typename T, typename Compare = std::less<T> > class SortedList { private: struct ListNode { ListNode …

Member Avatar for mIXpRo
0
192
Member Avatar for snipermann

Hello I have a problem with reading the coordinates of points which are extracted from (..txt ) file.I have read the file with ifstream but I don't know how to use the information then. Thanks in advance the point are in File as followed : u:1.2000 v:4.5400 u:2.5450 v:6.4500

Member Avatar for jonsca
0
327
Member Avatar for imolorhe

I have a program that accepts multiple lines of strings for a variable and accepts another set of multiple strings for the next set of variables, and so on, each seperated by a free line i.e.\n\n How do I write such a program?

Member Avatar for jonsca
0
64
Member Avatar for frogboy77

[CODE]bool is_prime(int a) { if(a==1){return false;} if(a<4){return true;} if(a%2==0){return false;} if(a<9){return true;} if(a%3==0){return false;} int i; for(i=5;(i*i)<=a;i+=6) { if(a%i==0){return false;} if(a%(i+2)==0){return false;} } return true; } [/CODE] critique welcome.

Member Avatar for frogboy77
0
117
Member Avatar for Mr_PoP

main.cpp [CODE] #include "includes.h" #include "LOGMSGs.h" int main() { LOGMSG("TEST"); getch(); return 0; } [/CODE] MYSQLcon.cpp [CODE] #include "LOGMSGs.h" int Mysql() { MYSQL *con, mysql; mysql_init(&mysql); const char * host="localhost"; const char * user="test"; const char * pass="test"; const char * db="NewServer"; con = mysql_real_connect(&mysql,host,user,pass,db,NULL,NULL,NULL); if (con == NULL) { …

Member Avatar for Mr_PoP
0
109
Member Avatar for akifateef

i am a student and i use turbo c 3.0 and 4.5 its compulsory for the computer programming course but there is one error i get when try to run a code having graphics.h on 4.5 that BGI graphics not supported under windows but the same code runs fine on …

Member Avatar for Ancient Dragon
0
103
Member Avatar for Aequitas1

Good evening. I've recently had an assignment to create a doubly linked list that is self contained. This means that the entire list is contained in a single class - the class acts as both the list and the node. I've completed everything and have gotten to my final task …

Member Avatar for Aequitas1
0
4K
Member Avatar for Mr_PoP

logmsg.h [CODE] void LOGMSG(string logmsg,...)//... { stringstream name; name<<"test "<<TM.years()<<"-"<<TM.month()<<"-"<<TM.day()<<".log"; ofstream log; log.open(name.str(), ios::out | ios::app); log <<TM.hour()<<":"<<TM.mint()<<":"<<TM.sec()<<" Message: "<< logmsg<<endl; } [/CODE] main.cpp [CODE] int main() { int a = 100; LOGMSG("type test!!",a,"times"); }[/CODE] but it's only wtite into the file "type test!!" while i want it to type …

Member Avatar for Mr_PoP
0
108
Member Avatar for rcmango

I'm quite new to the standard template library, I'm trying to understand how to use them with my code. There may still be some logic errors in my code. However I am trying to sort out my syntax errors. One big one is this: type/value mismatch at argument 1 in …

Member Avatar for rcmango
0
527
Member Avatar for Violet_82

Hi there, it's been awhile :$ I have just completed a small easy exercise which was to create an Account class, providing a constructor to receive the initial account balance, add some money to the initial balance and withdraw some money (providing that the amount of money to withdraw is …

Member Avatar for Violet_82
0
169
Member Avatar for Frederick2

Hello Vivayan! Its taken me this long to understand your sophisticated program you gave me using STL (Standard Template Library) iterators, container classes, algorithms, and the works! I’m truly grateful for the time you took to develop this program for me, and it inspired me so much I’ve decided to …

Member Avatar for Frederick2
0
177
Member Avatar for MasterGberry

I have been doing a lot of reading online about memory stream types, and I am trying to avoid using the gcnew MemoryStream() from the System header in this program. Here is an example of what I need to be able to use it for. [CODE]var reader = new BinaryReader(new …

0
62
Member Avatar for HeartBalloon

[QUOTE]You said the function returns just a single character yet you are trying to return a character array. You can't have it both ways. What you should have done is [icode]char* getEmpName()const[/icode] -- notice there is a * after char to indicate it will return an array of characters.[/QUOTE] Hi, …

Member Avatar for HeartBalloon
0
380
Member Avatar for MasterGberry

I am having a mental block with this LINQ expression and cannot seem to figure out how I need to convert it to C++. [CODE](var item in inTables.SelectMany(table => table.Items))[/CODE] This code applies to the following piece of code [CODE] foreach (var item in inTables.SelectMany(table => table.Items)) { Trace.Assert(oldDrs.Position == …

Member Avatar for MasterGberry
0
378
Member Avatar for bensewards

Hey guys, This is only my second thread on DaniWeb and I am a beginner programmer. My code looks like this: (really easy to understand and shouldn't need any further explanation besides the fact that I need help understanding why when i give an answer related to the 'else' loop, …

Member Avatar for Fbody
0
588
Member Avatar for Frederick2

I don’t know why my operator += and operator + string class member functions are taking so long to do their job and are so inefficient compared to the Standard C++ Library String Class. Its not that they don’t work; its just that they are slower by a factor of …

Member Avatar for Frederick2
0
578
Member Avatar for sudhirs18

Hi, The program below takes input from user the marks of 10 students in 6 subjects and gives output as: [output] Maths Phy Chem Bio C.Sc Eng Tot Stud_Avg studentname1 10 20 30 40 50 60 210 35 studentname2 20 30 40 50 60 70 270 45 -- -- studentname10 …

Member Avatar for sudhirs18
0
161
Member Avatar for meensatwork

I tried many codes in internet for this but it says Access violation. Can somebody provide me the code snippets in C++ and C# for this?

Member Avatar for ddanbe
0
244
Member Avatar for lochnessmonster

beth = ted; // beth equal to ted ( 1776 ) beth = *ted; // beth equal to value pointed by ted ( 25 ) [B]beth = &ted; // is this statement result in a compiler error? if beth is an int variable[/B]

Member Avatar for ravenous
0
113
Member Avatar for pseudorandom21

Hi, I am in need of a good reference for C++/CLI. Right now I need to know how to exit the main loop of a form, such as if the user clicked the 'X' at the top right. Nevermind, the function Close() is what I needed.

Member Avatar for jonsca
0
304
Member Avatar for insanely_sane

Ok.. so uptil now I've been using the DOS compiler and IDE for C++, version 3.0 by borland...(which is like ancient history).. But now I think it's about time to upgrade :P So since I have been away from C++ for a loooooong time, I need to start from scratch. …

Member Avatar for mike_2000_17
0
192
Member Avatar for GeekInTraining

I have a program which needs to take the logical drives returned from the GetLogicalDriveString function and store them in a string array for later use in a filepath. I tried doing this directly and it failed. Here's my code: [CODE]#include "stdafx.h" #include <iostream> #include <io.h> #include <time.h> #include <string> …

Member Avatar for MosaicFuneral
0
442
Member Avatar for MasterGberry

Ok, so there is a place where the code is being converted into ASCII standard, and then being converted back I believe. I think I know how to do it, but I wanted to get help to make sure that when i am testing for bugs later that this isn't …

Member Avatar for MasterGberry
0
188
Member Avatar for caut_baia

Hello everybody.Say i have a template declaration of a class: [code] template <DWORD Style=BS_DEFPUSHBUTTON, LPSTR Type="button"> class WndObj { WndObj (); }; [/code] Now in the cpp file the definition should look something like this: [code] template <DWORD,LPSTR>WndObj<>::WndObj () {} //so i can go ahead and typedef WndObj<> Button; [/code] …

Member Avatar for mike_2000_17
0
106
Member Avatar for thekitoper

My c++ program asks for input of a integer type if the user inputs a character/string then the program crashes is there another method for this or another way to fix it thank you.

Member Avatar for pseudorandom21
0
339

The End.