51,593 Topics
![]() | |
Why won't this if statement compile? [CODE]int main1() { char o[15]; cin >> o; if(o == 'oscar') main2(); else cout << "\n\aIncorrect password.\n" << endl; main(); cin.clear(); cin.ignore(255, '\n'); cin.get(); return 0; }[/CODE] I am trying to set a password to access the program | |
How can I get a password that has been changed during the use of the program to be applied so that after the program is ended and started again, when it prompts for a password to start the program it wants the new password the user entered, not the original … | |
Hi, I'm using istream_iterator to read input from standard i/p and writing it to standard o/p using ostream_iterator. I expected it to print the input to the console when I hit enter and then exit but it loops for next input after printing and so on. [code=c++] #include <iostream> #include … | |
I need to create a C++ program, that one could get a list of suggestions when he's typing. for example: when we type the letter 'A', a list of words that start with the letter A should display. then when we type another letter 'P', the words should filter and … | |
Ok well my assignment is to write a program to gives me the total resistance in a circuit. The user is prompted for the resistance type and resistor value such as <1 200> 1 meaning in series, and 200 being the value of the resistor. When the user imputs -1 … | |
[COLOR="Red"]4.6 - Insert() vector argument specs. Iter or not?[/COLOR] This allows me to refer to the second spot in a vector named 'inventory': A) [CODE] vector<string>::iterator myIterator; cout << "\nYou found a compass"; inventory.insert((inventory.begin() + 1), "compass"); cout << "\nYour items:\n"; for(iter = inventory.begin(); iter != inventory.end(); ++iter) cout << … | |
How do i split a string word by word and store each word into a hashtable? please help Thanks, Saula | |
hey whatzzzup guys??? i just want to know if this c++ programming language is hard co'z my clasmates are keep on complaining abort that hehe | |
Hello, I am trying to write a simple program which listens to some data on network and writes to a file. I decided to use mmapped files because the data is very large (magnitude of 3-5 Gigs) and very fast. so as expected, i put the data in queue and … | |
please help me to get the month only from system. which mean the program dont need to display time , day and also year. how to do with it? i only know to display date. urgent, assignment needed. thanks alot first. | |
Ok i have had to post this a few times just to get a answer. I am trying to get a user to put in a answer to a question in a c++ console program and when he does it puts his answer into a .txt and sends it to … | |
G'day all... I know there's a sticky in this forum for books that are recommended as C++ references from newbies to advanced coders. What I'm wondering is this... What are the online resources you [B]most[/B] recommend for C++ coders? What I'm looking for are those resources that are so useful … | |
I can't seem to disable dynamic linking. How do I do this? I've tried the following: [CODE]babbage-dasnyder 19% mips-unknown-linux-gnu-g++ -static -static-libgcc hello.cpp babbage-dasnyder 20% file hello hello: ELF 32-bit MSB MIPS-I executable, MIPS, version 1 (SYSV), for GNU/Linux 2.4.18, dynamically linked (uses shared libs), not stripped[/CODE] But as you can … | |
I am learning wxWidgets to break free of console programming. I use Dev-C++, and I have installed all necessary DevPaks, and everything should work fine, except when I try and compile this code, I get: [Linker error] undefined reference to `WinMain@16' ld returned 1 exit status C:\Dev-Cpp\Makefile.win [Build Error] [Testing.exe] … | |
Hello, I am coping a problem with getline. I have a txt file that looks like the following.And my task is to read it and put them in a file that contains 10 columns and not 8. [CODE=plain]0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,1 0,0,0,0,0,0,1,0 0,0,0,0,1,0,0,0 0,0,0,1,0,0,0,1 0,2,2,1,0,2,6,5 12,17,12,28,39,40,46,71 [/CODE] and I have to read … | |
Command line arguments in linux usin C programming lanuage | |
It's been so long since I sat down and coded something that didn't require me to think about what I wanted to code before hand; Can anyone give me any ideas about a cool program to make? I can effectively utilize CreateThread() and such from the Win32 API if that … | |
Hey guys, my friend helped me with a code, but I didn't get a chance to ask him about why col is subtracted by 65? Can anyone tell me what exact that line is suppose to do. Thanks for dealing with me...the line is bold... [CODE]#include <iostream> //preprocesser directives using … | |
I have a list of books that I need to access from 3 or 4 different functions of my program. It's 250 books with unique names. Would it be wise to use simple array to store the list? Or is there any easy way for a newbie to manually create … | |
In my book, it says find() must be used like so: ex: iter = var.find(scores.begin(), scores.end(), score); but later it uses this in practice: ex: while (used.find(guess) != string::npos) Why can you simply pass 'guess' var to it here and not need to search a range? Isn't find() an algorithm … | |
Still learning and I just want to be sure I'm clear on a few very basic syntax issues. Any help is much appreciated. [COLOR="red"]5.1 - Basics[/COLOR] int = a single number? char = a single letter OR number? string = a phrase of letters (up to?) char array[]; // array … | |
I have a question on Chapter 4, exercise 1 of Michael Dawson's "Beginning C++ through Game Programming 2nd Edition". The chapter goes over STL, vectors and iterators. The assignment is to create a program that allows the user to edit games in a list. In the book we learn about … | |
Hey Guys, I'm having some trouble compiling my code. it says that there's an error in one of apple's header files. /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/usr/include/arm/_types.h:13: error: expected constructor, destructor, or type conversion before ‘typedef’ nvm, solved | |
I am trying to get the following code to take in either a number or an integer, determine whether what the user inputted is an integer or a letter, and then print a random digit if it is an integer, or a random letter if it is a letter. [CODE]#include … | |
[COLOR="Red"]Help me .. I can not understand this question.. What does the following function do?[/COLOR] void insert(int a[], int& n, int maxsize, int index, int key) { if (index < 0 || index > maxsize-1) { ; } for (int i=n; i>index; i--) { a[i] = a[i-1]; } a[index] = … | |
![]() | Can someone help me develop the pseudo code for this so I can try and code it out? I'm getting confused about how to develop this simple program: Problem: Develop a Null Cipher Coder using Nested Loops and Command Line Arguments: Encoded .cry files can be found here: I downloaded … |
Thank you for reading my thread. I am experiencing an issue using struct tm and I can't figure out what I am doing wrong. I have looked at several examples and read up on the structure, but to me it all looks right. I would appreciate some fresh eyes on … | |
I posted an earlier question and got no answers, which really is BS. so ima try again... I am trying to make a console program that can create a text document, and send it over ftp. thats it, I would like it if someone could point me in the right … | |
Hi all, Im working on the design of a function at the moment and im not sure if the if statement i want to do is safe. Ill start with the data structures i have as this is where the problem could come from. (simplified with relevent bits only) [code] … | |
For a program I am working on, I need a way to use an if function for a variable, if the variable is within a certain range of numbers. i.e. [CODE]if(x == 1-5) // meaning if x is from 1 to 5 //do something... if(x == 6-10) // i.e. if … | |
Hello Everyone, I have been thinking about an assignment for couple of days and tried some methods but none works really perfect; I certainly don't need code, I just need some problem solving assistance. The question is, I'm supposed to read a text from a file, and then put them … | |
Hi.. somebody help me to implement c++ in Wifi development.. you will thankful.. | |
[code=c]#include<iostream.h> #include<stdlib.h> #include<time.h> #include<stdio.h> #include<conio.h> #include<windows.h> class TelCom { public: void menu(); void billing(); void viewlogs(); void prepaidOperations(int form); double compute(char user[9],int cid,char plan,double csms,int cmms,double ccall); }; class BoxLines { public: void box(int x1,int y1,int x2,int y2); void line(int x1, int y1, int x2); }; void sleep(unsigned int mseconds) … | |
I get runtime error when I run the application Thread ^readThread = gcnew Thread(gcnew System::Threading::ThreadStart(this, &PipeServer::Read)); readThread->IsBackground = true; [b]readThread->Start(client);[/b] The Error is: [COLOR="Red"][b]The thread was created with a ThreadStart delegate that does not accept a parameter[/b][/COLOR] Please help me to solve it, Thanks in advance. Regards, Rupendra | |
Hi, My Application's icon is not getting displayed after disabling "System Menu" option from Dialog Property. I don't want to use the system menu and close button. See the attachment for detail. | |
Hello all, I am using R for my analysis and require C++ code to access in R. I used Rcpp package in R to accesss C++ code. But when I use the function given as an example: [CODE]const char* hello( std::string who ){ std::string result( "hello " ) ; result … | |
Please help me on this one using c++ Input: 21 Output: 10101 this is our exam in automata.. | |
Hello, First of all, I would like to say that I'm a newbie in visual studio. I come from a php/mysql background involved in web development. My task here is to create an real estate application for my company. I have so many questions but first I would like to … | |
I'm a newbie C# programmer, and I would like to ask for help on this error. I was trying to get a button to change its image when it is clicked, a task that sounds so simple, I know, but whenever I run the program and click said button, it … | |
Hi All.. I have developed a tool in C++ and I want to check the performance of the tool using [COLOR="Red"]callgrind[/COLOR]. For the first time I have executed my tool with different input sets and I have taken the number of instruction cycles as the referance for further usage. Following … | |
I am using Xcode on a mac osx with c++ and std project, I get the following error when I try to compile Build OpenCLCpp of project OpenCLCpp with configuration Debug Ld build/Debug/OpenCLCpp normal x86_64 cd /Users/mohammadjeragh/Documents/MyResearch/OpenCLCpp setenv MACOSX_DEPLOYMENT_TARGET 10.6 /Developer/usr/bin/g++-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/mohammadjeragh/Documents/MyResearch/OpenCLCpp/build/Debug -F/Users/mohammadjeragh/Documents/MyResearch/OpenCLCpp/build/Debug -filelist /Users/mohammadjeragh/Documents/MyResearch/OpenCLCpp/build/OpenCLCpp.build/Debug/OpenCLCpp.build/Objects-normal/x86_64/OpenCLCpp.LinkFileList -mmacosx-version-min=10.6 … | |
Hello all, how can I pass some input from Java ti C++ using sockets. The input is only two int numbers. Any help with the sockets, please. I'm new but I need them. | |
![]() | Hey guys I've tried searching the internet for an answer on this and have come up short. I was hoping someone that does this could help me out setting it up. I want to write C++ using Mac OS. I tried going the Xcode route but found Xcode to be … ![]() |
i want to delete an element of array structure to use it again to more understand look to the part of this code [CODE] struct patient { int ID; char name[100]; float age; char sex[7]; char adress[100]; char hometelephone[12]; char mobiletelephone[11]; char workingtelephone[12]; char date[12]; char time[13]; } patients[100]; void … | |
Hi, I am working on a project and when I run my code, I get a segfault. I checked it with valgrind, and it says that I am trying to access a memory location that I maybe not malloc'd, stack'd or recently free'd. The only 'mysterious' thing I'm doing is, … | |
My c++ code [CODE=c] string map = "111111111111111111111111111" for (int i = 0; i < 20; i++) { int number = atoi(map[i]); } [/CODE] Gave me error: cannot convert parameter 1 from 'char' to 'const char *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style … | |
Hello Everyone, my first post - so please don't shoot me if it goes wrong! I'd been looking for this for some time now and have seen a number of related queries but no solutions. I cannot take credit for the whole code here, but I did adapt it to … | |
Hi All I'm using SetWindowsHookEx to hook the keyboard. The connection is made and I am able to trap key presses. I'm also trying to call GetKeyboardState to obtain the state of the other keys at the time of the key press (to identify if shift, ctrl etc is pressed). … | |
From project euler : [code] By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. [COLOR="Red"]3[/COLOR] [COLOR="red"]7[/COLOR] 4 2 [COLOR="red"]4[/COLOR] 6 8 5 [COLOR="red"]9[/COLOR] 3 That is, 3 + 7 + 4 + … ![]() | |
Look [URL="http://www.spoj.pl/problems/ADDREV/"]here[/URL] for a complete description of the problem. Your code should follow the coding standards, good names, spacing, easy on the eyes...etc. Make sure you handle all test case and boundaries. Good Luck, and happy coding. Although this is a C++ forum, it would be nice to see some … ![]() |
The End.