49,755 Topics
![]() | |
i have also similar problem with getline : [CODE]int Books::InsertBook() { string authorName; cout << "id_code :" << endl; cin >> bookrec.id_code; cout << "info_title :" << endl; cin >> bookrec.info_title; cout << "author :" << endl; getline(cin,authorName); int authorID = train_Author::s_add_author(authorName); if(authorID==0) { cout<< "Operation cancelled!" << endl; return … | |
Hello, I am very new to programming and want to know if anyone knows of a good internship or course that they recommend, near San Diego California preferably. Also any seminars or useful websites that would broaden my IT/programming knowledge. | |
hello, I just wanted your input on this program(can it be more efficent?...and so on ). It's a simple program. It reads 5 integers and checks if its an palindrom or not. As you can see I am a beginner. here is my code: [code] #include<iostream> //#include<string> //#include<ctime> //#include<cstdlib> //#include< … | |
I know I can call another _Click event using this code: [code] button1_Click(this, EventArgs::Empty); [/code] But if I want to call a _Paint Event, this code will not compile. Is it different to call a Paintevent then a Clickevent or other events ? cannot convert parameter 2 from 'System::EventArgs ^' … | |
With this code I am setting a backgroundimage to a button. [code] mybutton1->BackgroundImage = Image::FromFile("D:\\pic1.JPG"); [/code] What I need to do is to also be able to remove this image from the button as it was before I did put the image to the button so the button doesn´t have … | |
I've just wrote this program and when i compile, the gets() function is skip before i can enter the string. i have try cin.getline but the same problem occurs. Can anybody tells me what's the problem and to solve it? [code] #include<iostream> #include<cctype> using namespace std; int main () { … | |
when someone include <iostream> how does the compiler know which library to load? | |
I am trying to write a function that reads numbers out of a string of comma separated values. The first function is: [code=cplusplus] unsigned get_frame(unsigned &index, char input[]) { const comma=','; char *letter; char *accum=""; unsigned out; while (input[index]!=comma) { *letter=input[index]; strcat(accum,letter); index++; }; out=atoi(accum); index++; return(out); }; [/code] This … | |
Hi How to convert CString to char* in C++ Regards Karan | |
I want to ask user to input two parameters of one product and I want both of them to go on the same line. However, I also want to have some text between the values that user inputs. So, I want to have something like this: 1) Initial text: "Oil … | |
To get things started, I am re-writing an application that I originally wrote in perl. So I am some what sticking with the same concept as I did for the perl version. This application uses multithreading in order to handle multiple configurations and data streams. At this point, I have … | |
This code here is giving segmentation fault. Any clues why? also any general tips for writing good multi-threaded code are welcome. [code=c++] #include <windows.h> #include <process.h> #include <iostream> using namespace std; unsigned __stdcall Display(void* p) { Sleep(500); cout << "Display" << endl; cout << *((int*)p) << endl; return 0; } … | |
hello, i have just started trying to learn c++ and have been told to create a game of connect four player vs comp. i have managed very little and am stuck on trying to get the computer to recognise that when the cell is occupied rather than not put the … | |
how it is logical to get this to work? [CODE]#include <iostream> using namespace std; int main() { int a; if(a = 0) { cout<< "oldu" << endl; } else { cout << "olmadi" << endl; } return 0; }[/CODE] whereas in c# you can not do something like below : … | |
Hello! I muss create a diamond shape, with 4 (triangles). The first 2 i was able to make it, but 2 others not. So i need some beginners help. [code] //* //** //*** //**** //***** for (int i=0;i<value-1;i++) { for (int j=0;j<=i;j++) { cout<<"*"; } cout<<endl; } for(int a=0; a<value; … | |
I need to use an array of chars to input chars from the console but I don't know how many chars will be actually inputed. How can I have an array of chars whithout knowing its size in advance? I could put the array with a very high size but … | |
Hi all, I am making a text game in c++ and i am trying to get the player's attack to ba a random number between 1 and 7, but when i try to compile it, it gives me this error: 49 C:\Documents and Settings\Games\Desktop\C++ Tutorial\Combat\main.cpp void value not ignored as … | |
Hi I have a value of emdash — First of all I want to know Is this — a unicode If Yes How to convert unicode i.e. — into -- using code in VC++ Regards Karan | |
Hello. I have encountered a problem while programming. I'm trying to put my outputs into a chart, but the lining does not stay the same, so sometimes I get a perfect chart, and sometimes I get a totally imperfect chart. Can anyone give me the solution to this? Thank you … | |
In Visual C++ Express Edition you can insert button controls on a form. These buttons has a rectangular form. You can even do them like a square. Is it possible to do Round Buttons in C++, like this letter: [COLOR="Red"]O ? [/COLOR] (It is important that the area where you … | |
I have a project that consist of 2 Forms. I am trying to open Form2 with this code but when I compile the project I have this compile error and wonder what this meens and why it doesn´t work. cannot convert from 'System::Windows::Forms::Form ^' to 'Form1::Form2 ^ 1> No user-defined-conversion … | |
I have no idea how to make somthing like this, and i'm kind of new with file I/O. How would you start somthing like this? O.k. here is what I have to save, I have roughly 56+ variables that need to be counted in this. But what I am having … | |
Hey, I'm having a problem reading from a device attached to my serial port. I have a big application which uses a thread to read from the serial device and writes the data to a log file. The device is set to transmit data at 500Hz, which means that my … | |
Hi How can I set the include path in C++ using command line Regards Karan | |
I have assigned a backgroundimage (JPEG) to a button. Is it possible to programatically make this image visible = true or visible = false ? Like you have this beginning: [code] button1->BackgroundImage-> Visible = true, Visible = false in any way ? [/code] | |
create a program that includes two functions named calcavg() and ariance(). The calcavg() function should calculate and return the average of the values stored in an array named testvals. The array should be declared in main() and include the values 89,95,72,83,99,54,86,75,92,73,79,75,82,73. the variance() function should calculate and return the variance … | |
I try to find an event for if you rightclick and leftclick a buttoncontrol in a Form application. Simply, to detect if it is the left or right button on the mouse that is clicked. What I want to do is that if I rightclick a button I want the … | |
Hi, I'm writing a template class as below. Trying to add a funtion to browse all the elements of an instance, that needs a vector iterator. When I compile the code getting a list of errors. Two of them typically draw my attention. The Error reads [B][COLOR="Red"]error:[/COLOR][/B] dependent-name ` std::vector<T,std::allocator<_CharT> … | |
I've been reading up on templates and they just seem like so much hastle for so little reward. I can't find anyway to effectively use it over vectors. I am just having a lot of trouble learning them because the concept seems so weird. | |
if i want to check that wether the entered character is char type or int type,how can i do that? |
The End.