49,755 Topics

Member Avatar for
Member Avatar for serkan sendur

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 …

Member Avatar for serkan sendur
0
2K
Member Avatar for CPPRULZ

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.

0
53
Member Avatar for mrnutty

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< …

Member Avatar for grumpier
0
95
Member Avatar for Lukezzz

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 ^' …

0
50
Member Avatar for Lukezzz

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 …

Member Avatar for Lukezzz
0
92
Member Avatar for lara_

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 () { …

Member Avatar for Narue
0
2K
Member Avatar for serkan sendur
Member Avatar for Narue
0
107
Member Avatar for tgreiner

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 …

Member Avatar for Narue
0
142
Member Avatar for karang
Member Avatar for Werdan

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 …

Member Avatar for MosaicFuneral
0
604
Member Avatar for rottmanj

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 …

0
67
Member Avatar for Agni

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; } …

Member Avatar for Salem
0
188
Member Avatar for new2c++

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 …

Member Avatar for MosaicFuneral
0
98
Member Avatar for serkan sendur

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 : …

Member Avatar for Narue
0
113
Member Avatar for stindeee

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; …

Member Avatar for Lerner
0
84
Member Avatar for babi

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 …

Member Avatar for Freaky_Chris
0
526
Member Avatar for tomtetlaw

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 …

Member Avatar for Narue
0
292
Member Avatar for karang

Hi I have a value of emdash &#8212; First of all I want to know Is this &#8212; a unicode If Yes How to convert unicode i.e. &#8212; into -- using code in VC++ Regards Karan

Member Avatar for ArkM
0
348
Member Avatar for Takeian

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 …

Member Avatar for Murtan
0
78
Member Avatar for Lukezzz

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 …

Member Avatar for Liszt
0
3K
Member Avatar for Lukezzz

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 …

Member Avatar for Lukezzz
0
99
Member Avatar for Shinedevil

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 …

Member Avatar for daviddoria
0
137
Member Avatar for GadiK

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 …

Member Avatar for GadiK
0
2K
Member Avatar for karang
Member Avatar for serkan sendur
0
143
Member Avatar for Lukezzz

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]

Member Avatar for Lukezzz
0
56
Member Avatar for dextrew

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 …

Member Avatar for William Hemsworth
0
191
Member Avatar for Lukezzz

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 …

Member Avatar for Lukezzz
0
984
Member Avatar for mrinal.s2008

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> …

Member Avatar for mrinal.s2008
0
206
Member Avatar for Manutebecker

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.

Member Avatar for ~s.o.s~
0
139
Member Avatar for nida afaq

if i want to check that wether the entered character is char type or int type,how can i do that?

Member Avatar for Narue
0
108

The End.