51,592 Topics
![]() | |
I'm growing increasingly confused by the '^' symbol. I have been able to track it down on various sites but there is no real "definition" of it and its usage anywhere. I am creating a .NET project these days and I bumped into the symbol for the first time in … | |
[code]#include<stdio.h> void main(); { clrscr(); char a,b,c; printf("The quick brown fox jumped over the lazy dog"); getch(); }[/code] | |
Hi, I know the code for this post is quite long, but I thought it would be best to be comprehensive about what i'm trying to do as i'm not exactly an expert in this area of programming. I'm stuck trying to work out how to get windows hook procedures … | |
I use Dual OS. C: is Vista and F: is XP package 3. I downloaded code::blocks from [URL="http://www.codeblocks.org/"]here[/URL] and I also follow the instruction. I successfully installed in C: and I can compile "hello world" When I installed in F:, I cannot compile. though I changed the path from C:/~ … | |
hi all, i want to run a while (some condition holds) loop, and each time it is executed create a variable, a different one. my problem is: how do i get them to have different names, in particular, ongoing ones like "entry1", "entry2",... can i have like a counting integer … | |
hi, i want to have a vector of strings. i know i could declare it by [code] #include <iostream> #include <string> using namespace std; vector<string> vec; vec.push_back("this"); vec.push_back("is"); vec.push_back("my"); vec.push_back("array"); [/code] but thats very tedious. isnt there a more elegant way? if i had the vector as an argument to … | |
Ok, so I'm really after knowledge rather than a quick easy solution here. I am part of a team that is currently working on the development of a 'kind of' physics engine but I have hit a small wall since adapting the functionality of a class which was previously working … | |
Hey, I have an item class: [CODE] #pragma once using namespace System; using namespace System::Drawing; ref class Item { public: Item(void); int Type() { return _type; } void Type(int value) { _type = value; } String ^ Text() { return _text; } void Text(String ^ value) { _text = value; … | |
I created this function for my program : [CODE]int calcTotal() { petShop p; fstream f1; f1.open("Pet_Shop.dat",ios::app|ios::binary); int loc; loc=p.tellp(); float records; records=loc/sizeof(p); cout<<"Total number of records = "<<records; cout<<"Going back to main menu"; menu(); }[/CODE] I am getting this error : [CODE]error C2039: 'tellp' : is not a member of … | |
Hello! I am probably just going mad but. This code: [CODE]using namespace System.Windows.Forms;[/CODE] Generates the following error 1>GUItest.cpp(6): error C2143: syntax error : missing ';' before '.' 1>GUItest.cpp(6): error C2059: syntax error : '.' ..And I haven't the foggies why. Seems I cannot use .'s when declaring a namespace.. | |
how can i make the ide word wrap when i am writing lines of code, the code goes so far in width that I have to use the arrow button on my keyboard to see the end of line dev c++ 4.9.9.2 windows xp | |
Well I'm having quite a bit of errors with my code and have tried figuring out how to fix it, but I can't seem to figure out what is wrong. Here are the errors 1>------ Build started: Project: circle, Configuration: Debug Win32 ------ 1>Compiling... 1>circle.cpp 1>c:usersemcydocumentsvisual studio 2008projectscirclecirclecircle.cpp(38) : error … | |
I need to create a new txt file using ofstream, but I need to use a string to name the file. For example: [CODE] string string1 = "testfile.txt"; ofstream myfile; myfile.open (string1);[/CODE] but when I try, it says I can do this because string is not a valid variable type … | |
I am trying to say "if variable is NOT greater than or equal to, then do this" Here is how I tried to write it: [CODE]if(mouse_x !>= 300){ blah blah blah }[/CODE] But my complier doesn't like that. Does anyone know what I did wrong? Thanks. | |
Design and run a program that takes a numerical score and outputs a letter grade. Specific numerical scores and letter grades are listed below: 90-100 = Grade A 80-89 = Grade B 70-79 = Grade C 60-69 = Grade D 0-59 = Grade F In this program, create two void … | |
I am working in Microsoft Visual C++ 2008. Here is my sum of digits code: [CODE]#include <iostream> using namespace std; int main() { int num; int sum=0; cout << "Number, please? "; cin >> num; while (num>0) { sum=sum+num%10; num=(num-num%10)/10; } cout << "Sum of digits: " << sum << … | |
Hello. I'm very new at C++ world, so, I need some help. I'm building an Browser Called iNet, and, it gave me 4 errors: c:\users\sepultura\documents\visual studio 2008\projects\inet 0.1\inet 0.1\iNet.h(193) : error C2039: 'timer1_Tick' : is not a member of 'iNet01::iNet' c:\users\sepultura\documents\visual studio 2008\projects\inet 0.1\inet 0.1\iNet.h(22) : see declaration of 'iNet01::iNet' … | |
i am pretty new to c++ and dark gdk. im trying to make a simple platform game to start off. i have the basic controls down, the animations, and collision. but i am having much trouble finding how to create the effects of gravity. please help. | |
Hi everyone, I'm not so sure if this belongs in here or in computer science but I think as I want to use c++ this may be the place. I was wondering if anyone could point me towards some tutorials/references or books on methods for approaching the design of larger … | |
I am trying to implement the A* algorithm in C++ ([url]http://en.wikipedia.org/wiki/A*_search_algorithm[/url]). The pseudocode i am trying to implement is: [code]function A*(start,goal) closedset := the empty set // The set of nodes already evaluated. openset := set containing the initial node // The set of tentative nodes to be evaluated. g_score[start] … | |
hi frnds!! i have d code for series x^!+x^2+x^3+....x^m with single loop only //wap to find sum of series and print series also //x+x^2+x^3+......x^n #include<iostream.h> #include<conio.h> void main() { clrscr(); int n,x,count1; int sum=0; cout<<"enter a number"; cin>>x; cout<<"enter nth term till which u want to compute"; cin>>n; int count=1; … | |
Can smeone help me to write a prog. to find the sum of the following series: 1+(1+2)+(1+2+3)+....... n terms Regds. TEJAS | |
Hello all. I am working on this program and having some troubles with it. I have tried lots of different things and can't get it to do what I want. I guess I am not really understanding the code and how to word it properly. I am writing a program … | |
Hello. Can anyone help me how to implement the subscript ([]) operator for a STL list class ? [code] T& operator [] (int n) { } [/code] [code] template <typename T> class list { public: struct node { T data; node* prev; node* next; node(T t, node* p, node* n) … | |
Due to various posts asking for syntax highlighting, I decided to give it a shot & come up with a Syntax Highlighter for multiple languages. Also as many posters want to Copy it to Word, I added a functionality to directly export the highlighted code to MS-Word. Both the highlighting … | |
I have to make a program that takes 4 inputs and outputs the 2 largest inputs. So I wrote this code, [CODE] #include <iostream> using namespace std; void largest_two ( int input[4], int output[2] ) { bool restart; int i; int temp; do { restart = false; for ( i … | |
I've been trying to learn C++ for about a year now and came across [URL="http://openbookproject.net/thinkcs/cpp/english/chap04.htm"]this excellent tutorial[/URL]. I can't leave anything alone so I changed some single quotes to double quotes and have the following code:[CODE=C++]#include <iostream> void printTwice(char phil) { std::cout << phil << phil << std::endl; } int … | |
Below is the code I wrote, for taking the arrow key imput, just wanted to share it and get some feedback thanks :) [CODE]#include <iostream> #include <conio.h> using namespace std; int main() { int number = 0; int number2 = 0; while(true) { int arrow = getch(); if (arrow == … | |
![]() | Hello everyone, I have a problem in my Borland C++ project. I need to use my own COM object written in C# (this COM allows me to directly print PDF files) in my another project in C++, but as soon as I call some COM functions which require a string … ![]() |
This code is supposed to get one int and one string.But after entering the int, the [B]getline[/B] line is acting weird...it dont prompt me for any string input, rather then it shows the same value as the int. [CODE]#include<iostream> #include<string> using namespace std; int main() { int teacherID; string teacherName; … | |
I'm trying to use a switch statement in my code but I'm having a bit of difficulty. I have an error message I do not understand and do not know how to fix. The message reads, "switch quantity not an integer". I'm new to C++ and would appreciate any help … | |
Well, this project I'm working on is a Pokedex Program for my little sister for her birthday. Anyways, I have a file PokeList.txt, which I want to store every Pokemon next to their ID number. The text file is: [code] 1. Bulbasaur 2. Ivysaur 3. Venusaur 4. Charmander 5. Charmeleon … | |
I have a function called read() that interacts with some hardware and sometimes it returns the value very quickly and other times it could be very slow. I would like to have a timeout associated with my function read() so that if it takes over maybe a second then the … | |
I have been using Borland Turbo C++ 3.0 to get started with C/C++. I am making a graphics application and this error has come up. I know that my code is too big but I cannot cut it down and I need to add more features. Can someone please tell … | |
Hi all, I have started a wiki that I hope to make the "unofficial Daniweb wiki". Its mission is to present short, compilable answers to many commonly asked questions here on the forum. [url]http://programmingexamples.net[/url] I have seeded it with a handful of basic operations. Please feel free to edit, add … | |
Hello eople i never post anything here because i always find a solution to the problem but this one is out of my range, ok so when i want to start a new cons or Win32 app i go normaly to FILE->NEW->PROJECT and click for example console mode and then … | |
I am trying to grab some data after opening a text file with append flag. I am using the following code...but nothing is being printed and program execution is progressing forward. Can anyone point me my mistake... [CODE] fstream outStream("test.txt", ios::app);string testID; cout << "Enter Teacher ID - "; cin … | |
PPPPPPPLLLLLLLZZZZZZZZZZZ tell me which type of logical error does exist in this program.it evaluate numerical expression correctly but the problem is in alphabetic expressions plz tell me the output of a+b & also of a+b*c/d^e so I'll match my output result with Ur answer Ur replies are not satisfying me … | |
Hey, I have the code: [CODE] Form1(void) { array<Label ^>^ labels = gcnew array<Label ^>(itemCount); InitializeComponent(); for (int i = 0; i < itemCount; i++) { labels[i] = (gcnew Label()); labels[i]->Tag = (int)i; labels[i]->Location = Point(1, (i + 1) * 50); labels[i]->Size = System::Drawing::Size(250, 50); this->Controls->Add(labels[i]); } } [/CODE] This … | |
Hi I want to write a file shredder in C++. What I know is that I need to overwrite things with 0 but I am not very much clear on this. What concepts should I know to program it ? | |
Hi Everyone, I'm working in with a file and somewhere in it I'm reading a number that i know it's starting and endig position n the file and then i store it in an string*. But at the end I need to convert this string to the int value. I … | |
He all I am currently working a on a problem to convert the entire contents of an STL container into a string. For example if I had this: [code=c++] int foo[] = {1, 2, 3, 4, 5}; vector<int> bar(foo, foo + 5); [/code] I would like to convert [icode]bar[/icode] into … | |
So far I have written a program that draws text to the screen and I am able to change the font type but I am unable to change the font size. Here are the 3 main parts of my code that I think you need to see. Font structure: [CODE]typedef … | |
Hi, I'm having trouble with my program,here is one of the error code: Error 1 error LNK2019: unresolved external symbol "public: __thiscall linkedListType<int>::linkedListType<int>(void)" (??0?$linkedListType@H@@QAE@XZ) referenced in function "public: __thiscall linkedQueueType<int>::linkedQueueType<int>(void)" (??0?$linkedQueueType@H@@QAE@XZ) main.obj Mesina_Wk5Assignment The following are the codes to my program [CODE] // linkedList.h file #ifndef H_LinkedList #define H_LinkedList #include … | |
I am trying create a button that when clicked prints hello world in the text box above it. however im a complete noob on winforms. I normally just make console programs any tutorials on winforms ? with C++? | |
Hi, I'm trying to create a 2d array that will fill itself up with numbers i have in a text file. My text file looks like this: 1 5 4 2 6 3 3 9 4 4 1 8 5 2 2 So, I want to create an array with … | |
Hello All I’m trying to hook the mouse scroll wheel using SetWindowsHookEx with WH_MOUSE_LL. The callback function I am using operates correctly, and identifies when the mouse wheel is scrolled. However I am unsure of how to identify which direction the mouse has been scrolled. My code so far: [CODE] … | |
if i were to create a program which required the user to enter multiple values, but i do not no how many. How would i go about anticipating the input. For instance if the user were permitted to input any amount of numbers and i wanted to add all the … | |
Hi I started a thread earlier back and I thought my problem had been solved but now new errors have popped up Here are the errors I'm getting: bfs.cc: In function 'void greedyMatch()': bfs.cc:9: error: expected primary-expression before 'for' bfs.cc:9: error: expected `)' before 'for' bfs.cc:9: error: 'bfs_ee' was not … | |
Hi guys, I am stuck with this piece of code for a long time. The errors that come are: bfs.cc: In function 'void greedyMatch()': bfs.cc:9: error: expected initializer before '*' token The relevant code is [code=c] #define forallXNodes(u,G) \ for(arc *bfs_ee=(G.getSource())->firstOutArc(),arc *bfs_stopA=(G.getSource())->lastOutArc(),u=bfs_ee->head(); bfs_ee <= bfs_stopA;u = (++bfs_ee)->head()) #define forallYNodes(u,G) \ … |
The End.