49,761 Topics

Member Avatar for
Member Avatar for osama.11
Member Avatar for osama.11
0
79
Member Avatar for Tycellent

std::endl vs \n Are any particular one which should be used at specific times? I understand endl flushes the stream (although i'm not 100% what this means) while \n is simply a newline.

Member Avatar for rubberman
0
401
Member Avatar for shahera.arafat

hii everyone :)) I want to write a prog. that the user can enter e.g (new 1112236) in the black screen ,, then the prog. should go to the (new)func. and create a new node with that ID ..soo how can I split the strings ?and how can I define …

Member Avatar for tinstaafl
0
139
Member Avatar for Builder_1

#include<iostream> #include<conio.h> #include<string> using namespace std; struct node{ char data; node * next; }; void queue1(); void queue2(); void queue3(); void queue4(); void concatenate(); node * firstnodeptr1=NULL; node * lastnodeptr=NULL; node * firstnodeptr2=NULL; node * firstnodeptr3=NULL; node * firstnodeptr4=NULL; node *finalfirstnodeptr=NULL; int counter1=1,counter2=1,counter3=1,counter4=1; void main(){ char ch; do{ cout<<"enter the …

Member Avatar for NathanOliver
1
496
Member Avatar for Malkolm

I want to count how many times a quoted string appears in a string. `Today "is" a new day "because" it is "12" am.` A string like this should evaluate to 3. I don't know why my code prints 0. #include<iostream> #include<string> using namespace std; bool isQstr(string str); int main() …

Member Avatar for L7Sqr
0
288
Member Avatar for aluhnev

//Hi,i need to create programm,which takes the user input,determins how many digits in integer // and than raise this digit to power,what was entered by user too. //first function noraml,second one to rais to power recursive. So if user enter number //234,this is 3 digits,so now need recurcively 3 raise …

Member Avatar for Banfa
0
271
Member Avatar for aluhnev

//Hi all,can you explain how to call this function in main. //i ask user to enter the number,like this is it correct in main,recursevely call function? bool isPrime(int n, int d); int main() { int number; cout <<"Enter number >= 1"; cin >> number; if(isPrime(number)) { return cout << "Yes"; …

Member Avatar for aluhnev
0
5K
Member Avatar for bitwiseboredom

So I have this programming assignment I'm doing for my structured programming class (using the C language) that gives me a segmentation fault error. I rewrote the assignment in C++ and it worked fine, but since the class uses C, I must get to the bottom of this and submit …

Member Avatar for bitwiseboredom
0
753
Member Avatar for aluhnev

//Hi,can someone explain the meaning of [size -2],why not [size -1],if we narrowing the string int palindrome(char str[], int size); int main() { cout << "Enter a string: "; char str[20]; cin.getline(str,20,'\n'); cout << "The entered string " << ( (palindrome(str,strlen(str)+1))? "is":"is not" ) << " a Palindrome string." << …

Member Avatar for tinstaafl
0
239
Member Avatar for badmofo

I have an assignment to write a recursive function that takes one integer variable and output the integer in reverse order to the screen. I've tried converting it to a char array(c++ "string" class not allowed) but could not get a counter to work. I can reverse an int array …

Member Avatar for Ali_40
0
875
Member Avatar for rose_2

#include <iostream> #include <conio> void main () { cout<<"rose mary"; getch(); }

Member Avatar for tinstaafl
0
140
Member Avatar for myk45

I have a horizontal layout inside which i have added a group box. The group box is split using a QSplitter and contain a QListWidget and a QTextBrowser. I want to add two push buttons at the bottom right corner of the window to navigate inside the QTextBrowser. I'm adding …

Member Avatar for Banfa
0
450
Member Avatar for Rashmi_1

prog6.h #include "340.h" #include "binTree.h" #ifndef H_PROG6 #define H_PROG6 const vector < int > A{ 1, -2, 3, -4, 5, -6, 7, -8, 9, -10, 11, -12, 13, -14, 15 }; const vector < float > B{ 0.5, 1.75, -3, 4.25, 5.50, -6.75, 8, 9.25, -10.5 }; const vector < …

Member Avatar for Banfa
0
345
Member Avatar for bernardo.mclobo

Hi. I'm trying to implement a stack in C++, but i got stuck Here's my code #include<iostream> #include<cassert> #include<cstdlib> using namespace std; template<class Type> class stackTDA { public: virtual void initializeStack() = 0; virtual bool isEmptyStack() = 0; virtual bool isFullStack() = 0; virtual void push(const Type& newItem) = 0; …

Member Avatar for bernardo.mclobo
0
660
Member Avatar for M.Haephrati

Using Visual Studio 2013 C++, I got compilation errors that I couldn't explain. The compilation errors were: *main.cpp(325): error C2601: 'FLAG' : local function definitions are illegal main.cpp(323): this line contains a '{' which has not yet been matched main.cpp(326): fatal error C1075: end of file found before the left …

Member Avatar for mike_2000_17
1
697
Member Avatar for a272

down vote favorite I am currently working as a software developer. I studied science in college and used programming for a science project. However, I was able to obtain my first programming-related job a year ago due to connections. However, I am starting to hate the job (personal reasons, not …

Member Avatar for dternity
0
379
Member Avatar for rayhaneh

I dont know how to writ this program at first: I should write whith "function" which is definition of this function is : fk(n) for e.g-----> 10 ! =3628800 "the lowest non zero degit value" of 10 ! is "8" 12 !=479001600 "the lowest non zero degit value" of 12 …

Member Avatar for rayhaneh
0
178
Member Avatar for Lilgenski16

//Mad lib // Creates a story based upon user input #include <cstdlib> #include <iostream> #include <string> using namespace std; string askText(string prompt); int askNumber(string prompt); void tellStory(string name, string noun, int number, string bodyPart,string verb); int main() { cout << "Welcome to Mad Lib.\n\n"; cout << "Awnser the following questions …

Member Avatar for Lilgenski16
0
436
Member Avatar for shahera.arafat

hii :) I've seen alot in (void)func. that at the end of it they put (return;) why they put it ??what is the logical meaning of it ?? is it the same as (return0;) ?? actually it confused me alot :/ thanks ^_^

Member Avatar for mike_2000_17
0
190
Member Avatar for Web Spider

Hi there, I am working on signature based IDS, for this I have captured the TCP/IP traffic through Wireshark and got a pcap file, I want to extract some fields from the packet itself. How do I do this? I have been searching through the Internet and got the idea …

Member Avatar for L7Sqr
0
135
Member Avatar for Learner010

As usual, after learning new stuff, I write on it. Yesterday I finished learning on "Functions in C++" and found that functions are very easy to learn and useful. Hope this tutorial helps beginners. # What is function? # Sometimes when we want to execute a specific task wherever it's …

Member Avatar for Learner010
2
871
Member Avatar for fardous
Member Avatar for nitin1

I am using Eclipse and there is one strange error coming while building. In files, it is not showing any error but when I build it, it says **Description Resource Path Location Type Program "g++ -std=c++0x" not found in PATH test [Discovery Options] page in project properties C/C++ Problem ** …

Member Avatar for rayhaneh
0
110
Member Avatar for rayhaneh

hi ! I want to sum of digts on C++ but when get the nagative number give me the result if pastive number like when u write -98 answer u 17 not -17 #include<iostream> #include<math.h> using namespace std; int main(){ int N=0 ; cin>>N; int sum=0; while(N!=0){ sum += (N%10); …

Member Avatar for Lerner
0
177
Member Avatar for parvezshahjada

Input: String of expression A21 (+-) BB6C Output: 1) String T (+-)T 2) file 000 | 121 001 | BB6C write the program with C++

Member Avatar for NathanOliver
0
59
Member Avatar for HuePig

Hi, I have a Blackboard class and an Item class: void Blackboard::send(std::vector<std::string> msg, std::string to){ std::list<Subscriber*>::iterator p; for (p = subscribers.begin(); p != subscribers.end(); p++) { if ((*p)->getName() == to) //check if sender is subscribed { (*p)->update(msg); } else{ // reciever is not subscribed std::cout << "Can not find " …

Member Avatar for HuePig
0
128
Member Avatar for kareem.keko.35

hello . i have a task to make a program working by FIFO logic , i wanna help with it , i have to ask user to enter number of Slot then number of programs , then start add numbers i thinking a lot and used a lot of loops …

Member Avatar for ddanbe
0
78
Member Avatar for aulia.septadinarty

1>e:\aulia septa dinarti228\modul 1\final project uts\final project uts\final project uts.cpp(41): warning C4091: 'typedef ' : ignored on left of 'pasien::pasien' when no variable is declared. what is mean in error project ?

Member Avatar for Moschops
0
43
Member Avatar for gothv

Hey guys, So I have this atm machine assignment. Everything is working great, except I don't know how to declare char. I want to be able to choose between a, b, c & d. I am still a beginner we only covered 1 chapter so far in class so I'm …

Member Avatar for gothv
0
230
Member Avatar for Pyler

when compiling code from my main function ireceive the following error `error: conversion from 'rectangle*' to non0scalar type 'rectangle' requested` My code is quite simple; Here's my main function #include <iostream> #inclde "rectangle.h" using namespace std; int main() { rectangle rect = new rectangle(3,4); cout<<rect.area()<<endl; cout<<rect.perimeter()<<endl; return 0; } here's …

Member Avatar for Moschops
0
172

The End.