49,757 Topics
| |
Write a program to accomplish the following tasks: 1. Generate arbitrary number of random integer numbers between [0-100] 2. Save or load the numbers from/to a text file based on user option 3. Search the generated list for an arbitrary number entered by a user 4. Use Linear and Binary … | |
I could get this binary search to work... no matter what number i enter it will say "not found" even if its in the array; until, i sorted the array before searching. So, when making an array to search, i always have to sort it first? [CODE] #include <iostream> #include … | |
Hello, I have this code: [CODE] #include <iostream> #include <string> void main() { std::string a = "Sample"; printf("%s", a); std::cin.get(); } [/CODE] and it prints some I think random letters. Where i made mistake? And how should i change the code to write "Sample"? Thanks for answers and sorry for … | |
I wanna know how can I read a string from input which contains spaces and by string,I mean a string class object. thanks | |
Hi guys, Recently I have been trying to make a program, and Im stuck. I am trying to create a login function where by the first time a user logs in, their username and password are encrypt and placed in a file. Then each time that user logs in, the … | |
i am a c++ beginnner nd i am not getting the point why class is defined before main()function i.e globally:-O | |
See I probably have the littlest knowledge on working with Linked Lists and I was thinking of creating a program that will accept three numbers which will be arranged on the list. However, I need to display the numbers everytime I input them, which I don't know how. My goal … | |
So this is a topic asking for a good explanation if possible rather than code fixes :) So I had this code which originally took two parameters of pointer type and then I changed it to pointer references (or reference pointers?) (tell me which one it is) and it started … | |
Hello. I am working on many c++ programs right now that are mostly run in the form of an exe. I have noticed that most programs that i aquire from other people have some sort of installer. I can see how you would need to get all program files in … | |
Hello! I am working on a problem to count characters (without using strings) and I got my program to work! However, I got it to work before I put the code that counts characters into a function (countChar), which is required for this assignment. I'm not sure I understand how … | |
hi! i need help by creating a program that will divide using loops wihout using any division or multiplication sign. the allowed signs are just addition and subtraction. Thank you! i will post my program if someone replies with this. | |
When I was a student, I believe that most of the software programmers of every software companies must be very talented, brilliant, skillful and much more experience than me, at least before I got my first job, I really believe that every software companies could let me learn a lot.But … | |
back again with another question. i created a simple window in WIN32 mode, but it's giving me a linker error that i cannot isolate. [CODE]#include <windows.h> #include <tchar.h> #include <stdio.h> //defined this for all processes HINSTANCE hInstance; LRESULT CALLBACK WinProc(HWND hWnd, UINT msg, LPARAM lParam, WPARAM wParam); //WndProc Prototype. always … | |
Hey I am trying to have a combo box read the first child node in my xml file and formulate a list on that. Everything I keep seeing relates to C# and thus doesn't work very well. I was originally thinking of doing this by doing an event on the … | |
Hi, If i have to use managed code with unmanaged code. What are the possible risks? Thanks in advance. [CODE] cliext::vector<int> ^vec = gcnew vector<int>(3); [/CODE] | |
I have looked at several of similar topics and compared them with my code, but I don't see any of the same problems. Can someone else tell me if they see something wrong? Dev-C++ says "expected primary-expression before 'int'" and "expected ';' before 'int'" and that they are on line … | |
| Does anyone have an algorithm that generates all 10-digit integers that have at least one digit repeated? Trawling through all 9000000000 of them and checking them individually is too slow. Thanks. |
I wrote this program to make a linked list that holds a polynomial, which I then use in various operations. However, the program will not run at all. It builds correctly, but when I try to run it, it will either not come up at all, or it will come … | |
Hi mates, I am using visual c++ . I need to remove those lines which are full of zeros. Here is the matrice[5,7] : [CODE] 2 2 9 8 7 3 4 [COLOR="Red"]0 0 0 0 0 0 0[/COLOR] 3 4 5 7 8 9 6 [COLOR="Red"] 0 0 0 … | |
Hi, Need some help with MIPS I need to write a MIPS code that reads 10 characters string and then only print out value of 3rd, 5th and 7th character (remembering that first character is character 0) OUTPUT (should be somewhat like this): Enter 10 character string : i love … | |
Hello, i have a little big problem. I have an application that needs to 'download' two exe files but i don't want to make internet connections and ... So my application verifies the system time and should 'extract' the .exe for x64 or x86. But i don't know how to … | |
#include<iostream.h> #include<conio.h> int lsearch(int[],int,int); int main() { int ar[50],n,item,index; cout<<"enter the size"; cin>>n; cout<<"enter the array\n"; for(int i=0;i<n;i++) cin>>ar[i]; char ch ='y'; while (ch=='y') { cout<<"enter the no. to be deleted\n"; cin>>item; index=lsearch(ar,n,item); if(index!=-1) ar[index]=0; else {cout<<"sorry!no such element found";} cout<<"the deleted element is shown as (0)\n"; for(int i=0;i<n;i++) cout<<ar[i]<<"\n"; … | |
I was going through old programming tests from school and cam across this one that I got wrong and was wondering if anybody could help me out. We maintain our user list as an encrypted text file with the extension .LBE. We have a customer that is reporting that their … | |
/*any suggestions on how to convert a hexadecimal no. into others and vice versa?d code might be long, i'm just 16, dnt be harsh :)*/ #include<iostream.h> #include<conio.h> #include<string.h> #include<math.h> #include<process.h> main() { char a[30],ch; int len,i,j,pos,whole=0,k=0,n=0,r[30],lenr=0,lenq=0,q[30],h=0,base,base1; float frac=0; cout<<"Enter number"; gets(a); cout<<"Enter choice-b,o,h,d"; cin>>ch; len=strlen(a); switch(a[0])//for converting the no. inputted … | |
hi, i need to ask how to generate the negative answer? i have one formula. But always give me positive answer.. For exmaple: [B]AllocatDiff2 = 100 * -0.05;[/B] hope somebody can help me ...ASAP!! Thanks ... | |
please tell me step by step procedure to how to delete the thread that i post ?? please help me guys. | |
Hey, I'm trying to search a List for a substring, but even if it does exist the result is coming out as negative (not present) using the BinarySearch. The idea is that once the file has been loaded into the list I search to see if substrings exist (i.e. IDS_STRING1 … | |
hello all! i am working on a bank account type program where the user can add accounts delete accounts make deposits and so on. i have most of the code working but i am getting an error and i cant figure out whats wrong. if someone could steer me in … | |
Hello guys, So my task is the following: Draw a pine tree based on user inputted height. How tall should the tree be?: 6 /\ / \ / \ / \ / \ / \ ------------ || || || I had problems moving the cursor from the left to right … | |
// secondstohhmms.cpp : Defines the entry point for the application. // [CODE]#include <iostream> using namespace std; #include "StdAfx.h" void main() { int time,hour,min,sec; cout<<"Enter time in seconds :"; cin>>time; hour=time/3600; time=time%3600; min=time/60; time=time%60; sec=time; cout<<"\n\nThe time is : "<<hour<<"::"<<min<<"::"<<sec; } [/CODE] Errors: >c:\users\desi9991\documents\visual studio 2010\projects\secondstohhmms\secondstohhmms\secondstohhmms.cpp(4): warning C4627: '#include <iostream>': skipped … |
The End.