49,761 Topics
| |
I have the line [code=c++]#include <algorithm>[/code] at the top of a file, and the line [code=c++]nth_element(minRollArray,minRollArray+n,minRollArray+numSets);[/code] in one of the fuctions in that file. However, when I try to compile it I get the error error C3861: 'nth_element': identifier not found at that line. I would expect this if I … | |
There is a small program. [CODE]#include <stdio.h> void f(char **p); int main() { char *argv[]={"ab", "cd", "ef", "gh"}; f(argv); } void f(char **p) { char *t; t=(p+=sizeof(int))[-1]; printf("%s\n", t); }[/CODE] Assume the size of int is 4, I was asked to give the running result of the following code segment. … | |
Basically, I didn't know where to put this so I choose the Super of the 2 Languages. Our lecturer gave us an assignment to lay out diff. b/w C & C++, which started with a rather dirty spurge of concepts. He stated: In C program , the MAIN() should NOT … | |
codes for ice cream inventory system using borland c++ or c.. any reply is totally a BIG HELP!please please.. | |
Hello everyone. I already know the C code required to use SQL statements within C++. Using mysql_real_connect, I was able to establish a connection to a remote MySQL server. The problem is, even though mysql_real_connect did not RETURN NULL, (meaning that a connection to the mysql server was established) I … | |
How can I get the respondent to terminate my survey before all respondents have entered? That respondent may enter a specific number of out of range responses in a row. Below is my code: [CODE] #include <iostream> #include <cctype> using namespace std; const int STUDENTS = 10; // students entering … | |
Hey all! Here's my code: mm.cc: [CODE] int compute(int f, int c) { return f + c; } [/CODE] mm.h: [CODE] #ifndef MM_H #define MM_H int compute(int f, int c); #endif [/CODE] main.cc: [CODE] #include <stdio.h> #include "mm.h" int main() { int a; a = compute(10, 4); printf("Output: %d\n", a); … | |
Write a program that reads in a positive integer N and calculates and displays the sum of the first N even integers. For example if N is 6, the program should display the value 42, which is: 2+4+6+8+10+12=42. Caution: You need to write a program to do the addition. If … | |
I have been using c++ for a short time now and wanted to add sounds support via the OpenAL library, but I am having problems. In the end I tried to directly copy the code from a tutorial, but it is still not working. I have... [CODE]alutInit(&argc, argv); alGetError(); //////////////////// … | |
Can any body tell me what the below code does? The code is written in C++ language. ------------------------------------------------------------------------------------- [CODE]#include <stdio.h> #include "genlib.h" #include "simpio.h" main(){ int num1, num2, temp; printf (“Enter a positive integer: \n”); num1=GetInteger(); printf (“Enter a positive integer: \n”); num2=GetInteger(); while (TRUE){ temp=num1%num2; if (temp==0) break; num1=num2; … | |
I am trying to write a program that will read values from spreadsheets and stuff and I know I need to use CSV files instead of Excel files and stuff, but say I want to just read a single entry at a specific coordinate how do I access that one … | |
please i need fast answer about this i want to make Table but i guess i do something wrong can anyone tell me what the wrong i have done it [code]#include<iostream> #include<conio.h> using namespace std; void main() { char t=[3][3]; if (t[1][1]=x) cout >> t[1][2]=o; getchar();[/code] thanks very match :) | |
I was copying a c++ program and i came tosee something like this: char a[10][10]= {....} What does a[10][10] means?? what does the symbol [] do? Pls help me... | |
Hi, Im working on a desktop utility program, and right now Im adding functionality to launch exe's from it. My question is, are there any simple methods to launch an app using the windows library? Thanks. | |
Hi.. I will make a "release" of a project I have done in VC++ 2008 Express Edition. I go to: Project/Form1 properties. Here I choose: Configuration: Release In the General tab, I choose: Output Directory C:\Release & Intermediate Directory: C:\Release. In Debugging tab I choose: Command: C:\Release Now I press … | |
Hello. I'm trying to write a program witch asks you to write delay and then counts time left. But it's not working how it should. If i write number 9 or less it's working fine. But if i write number 10 or more it prints numbers wrong, ex. ir write … | |
Hi All, I am a newbie and am traking a course in Aptech for C++. Now my instructor asked me to make a program to create, display and insert nodes in a circular link list. I have made the following code: [CODE]#include "stdafx.h" #include <iostream> #include <stdio.h> #include <new> class … | |
[B]using c++ is there any way to cout<<"plz help"<<endl; // only when the space bar is press not enter [/B] | |
Hello, Is there any way of checking all elements in a queue without calling pop(). [code] while(!q.empty()){ cout << q.front() << endl; q.pop() } [/code] this is essentially what I have done. There is a bug in my program and I'm trying to check what is wrong. I don't want … | |
I am writing a client-server program in c++ in linux. I want a functionality in my server that when server is waiting for some response from client, it should not wait indefinitely. But if no response is received say within 30 secs from client, it should disconnect the client. Is … | |
hi, I am using mingw32-gcc-3.4.2 inside a windows XP Professional SP3 computer. For my project I uses libcomctrl32.a library.The compilation goes without an error. and linking too.But the problem is it crashed on the runtime.Then I add the -g option and debug it. Here is the stack trace that I've … | |
Take for example, the number 74.38145. The user inputs how many decimal points they wish to have displayed via the sprintf_s function. I can't for the life of me figure out how to best do this. I know how to display the float to a set number of decimal points: … | |
I'm a 12th grader.. I made a user defined(about 12 functions) c++ program about the working of bank ATM's... Now i want to convert the user defined program to data file such as "ATM.DAT". is there any way out, and please remember that i use only [B]two [/B]file commands - … | |
[CODE=cpp] while (j < i) { cin.ignore(); cout << "Please type enter to display: "; cin >> enter2; if (strcmp(enter, enter2) == 0) { cout << "ID: " << students[j].ID << endl; cout << "Name: " <<students[j].name << endl; cout << "Address: " <<students[j].address << endl; cout << "Telephone: " … | |
I have a problem in which we are given 2 sets A and B and we have to find set C which contains elements common to A and B.The set A and B can contain duplicates and set C is expected to contain distinct elements(i.e no repetition of the same … | |
Hi guys I had an idea for a fun project i would like to try, but i really have no idea where to start reading about the api's data formats and the likes. [U]What i want to do[/U] I would like to make an application as the start of an … | |
Suppose we've got two integer and character variables: [CODE]int adad=12345; char character;[/CODE] Assuming we're discussing a platform in which, length of an integer variable is longer than or equal to three bytes, I want to access third byte of this integer and put it in the character variable, with that … | |
hi, i was wondering if someone could help me make a number generator. By that i mean have it start from 0 then go 00 then 000 and so on until lets five zeros(00000) and after that make it change the last number by 1. Any help would be appreciated, … | |
What is the definition of memory in C++? thank you. | |
I've got a small project that I'm working on, and the core *.exe that I'm building has a decent amount of dependancies. I keep this, right now, in a folder of all the includes and a *.lib file for all the implementations. My question is, is there a way to … |
The End.