49,761 Topics
| |
c program to print table of a given number by user defined value | |
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. | |
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 … | |
#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 … | |
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() … | |
//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 … | |
//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"; … | |
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 … | |
//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." << … | |
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 … | |
#include <iostream> #include <conio> void main () { cout<<"rose mary"; getch(); } | |
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 … | |
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 < … | |
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; … | |
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 … | |
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 … | |
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 … | |
//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 … | |
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 ^_^ | |
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 … | |
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 … | |
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 ** … | |
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); … | |
Input: String of expression A21 (+-) BB6C Output: 1) String T (+-)T 2) file 000 | 121 001 | BB6C write the program with C++ | |
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 " … | |
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 … | |
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 ? | |
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 … | |
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 … |
The End.