49,761 Topics

Member Avatar for
Member Avatar for swissknife007

[CODE] #include <iostream> #include<stdio.h> #include<string.h> using namespace std; int main() { // cout << "Hello world!" << endl; int t,i,j,a,flag; char str[1000001]; cin>>t; while(t--) { a=1; scanf("%s",str); for(i=0;i<=strlen(str);i++) {flag=0; if(!isdigit(str[i])) {flag=0; for(j=i-1;isdigit(str[j]);j--) { if(str[j]!='0') { flag++; a*=str[j]-'0'; //cout<<"flag"<<flag<<" "<<a<<"A"<<endl; break; } } if(flag==0) { a=0;break; } } while(a>9) { if((a%10)!=0) …

Member Avatar for StuXYZ
0
518
Member Avatar for zekstein

I need some help here.. I need an example to do that : ( a background task ) #includes blablalbalbla void?? ExecuteTask () { while(1) { cout << "first " << endl; } } int main () { ExecuteTask( ); while( 1 ) { cout << "lol" << endl; } …

Member Avatar for zekstein
0
186
Member Avatar for jp071

Hello, I am doing simple read/write program for serial port. I am faceing a error that i donĀ“t understand. Error is: "error C2664: 'CreateFileW' : cannot convert parameter 1 from 'const char [5]' to 'LPCWSTR' " My whole program: #include <windows.h> #include <iostream> #include <string> using namespace std; void set_com_pin(bool …

Member Avatar for zeroliken
0
2K
Member Avatar for triumphost

Is there any C++ .Net IDE's around? I mean visual studio is ok.. it just isn't as good as SharpDevelop which only does C#, VB and a few others. It doesn't do C++ that's why I'm looking for a C++ version of SharpDevelop. Any Ideas? SharpDevelop [url]http://www.icsharpcode.net/opensource/sd/[/url]

Member Avatar for thines01
0
417
Member Avatar for jonnyboy12

Hello all, i working on a server I have realized that it only is using the loop back address of my ip. It looks like this. [CODE] struct sockaddr_in from; int fromLen = sizeof(from); SOCKET msgSocket = accept(listenSocket, (struct sockaddr*)&from, &fromLen); if(msgSocket == INVALID_SOCKET){ cout<<"Error at accept: "<<WSAGetLastError()<<endl; closesocket(listenSocket); WSACleanup(); …

Member Avatar for BobS0327
0
208
Member Avatar for rfrapp

My assignment is to create the Game of Life. I know that it is very easy to find out how to do this online, but I don't want the answers fed to me. Here's what I have so far: [CODE] // Life.cpp : Defines the entry point for the console …

0
120
Member Avatar for travelingt93

So i have a program i am writing,and i have come to problem. I want to be able to pass a set of three strings into a function, which should then take them and add them to a Vector. All good so far, now is where my problem develops, how …

Member Avatar for Ab000dy_85
0
205
Member Avatar for kimbokasteniv

What I am trying to do is the following: [CODE] ReceiptBag zero("zero"); ReceiptBag one("one"); ReceiptBag bags[2]; bags = &zero; (bags+1) = &one;[/CODE] Of course that is not valid code. My goal is to be able to reference the same zero or one object by using its variable name or by …

Member Avatar for kimbokasteniv
0
292
Member Avatar for irre

hello, im totally new to this forum, but i already checked whether my ask is answered somewhere else already. i couldnt find anything... i used to work with dev-cpp and i have to work with the cnum.h library a lot. Since im a student i am able to get MS …

Member Avatar for Ancient Dragon
0
179
Member Avatar for meetjatin88

Hi Everyone, I am Actually trying to make a simple C++ game in which some random alphabets will fall down and when we press one of those random alphabets keys the aphabet should disappear. The problem that i am facing in making this code is that when i am using …

Member Avatar for deceptikon
0
267
Member Avatar for sharath_137

Hi! I am new to this forum and for c++ also. Can any one tell me the exact difference Createthread,beginthread,beginthreadex........ I have searched many links but not of much use...... Sharath.

Member Avatar for PrimePackster
0
60
Member Avatar for Abhineet.Ayan

Hi All, Why my QueueUserWorkItem is not at all working. My code is here: [CODE] typedef struct { PCHAR URL[MAX_URL] ; PCHAR DestinationPath ; }MAINDATA, *PMAINDATA ; int main(int argc, char * argv[]) { PMAINDATA pData ; BOOL bQuwi ; DWORD dwIndex ; PCHAR pURL ; pData = (PMAINDATA)malloc(sizeof(MAINDATA)) ; …

Member Avatar for DeanMSands3
0
639
Member Avatar for Jigs28
Member Avatar for radiat

Hi, can you have a quick look at the two for loops here. I've declared the int 'i' in the first for loop but in the second for loop it doesn't recognise it and i have to declare it again. Why is that? [CODE]for(int i=0; i<x; i++) { cout << …

Member Avatar for MandrewP
0
173
Member Avatar for C++ programmer

Hi guys. I am a bit confused among the following three functions. read() readAll() readLine() How do they work? I'll be really thankful to you all. Thanks alot for your precious time! Regards.

Member Avatar for deceptikon
0
715
Member Avatar for Susmita_Sikder

hi all, i am working now in code::blocks and dev c++,but in both the cases output is not coming in fullscreen.so,how to view output in fullscreen? thanks in advance

Member Avatar for harinath_2007
0
236
Member Avatar for pattmorter

I was studying for an exam and came across two questions that me and my friends didn't know the answer to. We are given the answer but we just can't figure out what the answer is what it is. First, why does this code give an error? [CODE]int z=5, q=2; …

Member Avatar for Ali_2101
0
193
Member Avatar for madhusushmi

I am looking for fastest API to read/write files. Can you please help? I have checked such discussions here. But I am not able to figure out from those discussions. Please help.

Member Avatar for MasterHacker110
0
2K
Member Avatar for CY0T3R

1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 How To Print The Above Pattern ?? (Using For-Loops Only)

Member Avatar for ravenous
0
196
Member Avatar for Adnan671

Here are program instructions. IT SAYS "segmentation fault" WHEN RAN. Specifications You must create a Ship class: The Ship class maintains the position data for each ship/vessel and its distance from another Ship. It has a default constructor, which sets all of the member data to zero, and a non-default …

Member Avatar for WaltP
0
177
Member Avatar for jigglymig

my problem is that when I try and run it it says 'SortedList' : cannot instantiate abstract class due to following members: 'bool BasicADT::isEmpty(void) const' : is abstract ...and... 'int BasicADT::getLength(void) const' : is abstract can someone please tell me what I am doing wrong with my getLength and isEmpty. …

Member Avatar for BlueSky2
0
124
Member Avatar for skannigan

Hi, i want to write from one file to another. i managed to get the file to write but not in the way i expected it too, there is more to the program but for now i just need to know how can i mirror one file... My input file …

Member Avatar for skannigan
0
166
Member Avatar for radiat

Just studying dynamic memory at the minute. I understand the idea of having dynamic memory for arrays so you can set the length of them within the running of the program. But what is the point of dynamic memory for a single type? If i set an 'int' up to …

Member Avatar for radiat
0
125
Member Avatar for phorce

Hello, I'm just wondering really.. I have a 2D matrix but I've defined it as a 1D matrix. So for example: [code] double *matrix = new double[N*M]; [/code] My question is, I'm going to be manipulating data very shortly and want to read this data in from a text file.. …

Member Avatar for WaltP
0
233
Member Avatar for stannum

Hello, I joined about 5 minutes back. I need to complete my computer project, which is a hangman game in c++, by today. Based on what my teacher taught me, I have created a code that runs like this- [CODE]#include<iostream.h>//These are the only header files taught. #include<conio.h> #include<stdio.h> #include<stdlib.h> #include<string.h> …

Member Avatar for WaltP
0
291
Member Avatar for Zcool31

Hello everyone! I'm looking for a free (open source preferred) source code editor. Ideally it would be as light-weight as Notepad++, gedit, kate, mousepad, you see the pattern. However, the most important thing I'm looking for in this editor is flexible, dynamic, intelligent autocomplete (for c/c++). To be fair, Notepad++ …

Member Avatar for Zcool31
0
655
Member Avatar for tahsin.rahit

This code is giving me runtime error. Here, first I want to take a integer input which determine the number (n) of nodes in the graph. Then for n-1 time I want take two integer input which will give the adjacency information. [CODE] #include <set> #include <map> #include <list> #include …

Member Avatar for mike_2000_17
0
251
Member Avatar for Labdabeta

I have some code in C++ that uses an std::vector of std::strings to store an array of strings. I need to convert it into C. I thought that I would just create c versions of the functions I need (vector.back,vector.push_back,string.operator+=) but am getting lost in the double pointers. Can anybody …

Member Avatar for Ancient Dragon
0
177
Member Avatar for nell16

Pls help me on this. I really dont have an idea of solving this. Here's the question .. 1. Write a c++ program that generates the following series: 0 -1 4 -9 16 -25 36 -49 64 -81 100 and also this one 2. write a program that generates the …

Member Avatar for Ali_2101
0
259
Member Avatar for Labdabeta

I was wondering if there is any way using the mingw g++ compiler to make code that acts like this: [CODE]#define myLanguageBlock(X) doMyLanguageBlock(#X) void doMyLanguageBlock(const char* code){/*this executes the code as if it were in another language, I have already written this function*/} int main() { myLanguageBlock( this is all …

Member Avatar for Labdabeta
0
266

The End.