Software Development
Member Avatar

Yes, WPF. The learning curve is steep, but what amazing things you can do with it!
Look at this hexagon window for instance. Serves no purpose in a business environment …

Topic by ddanbe

Moved to code snippets. :)

Software Development
Member Avatar

Yes, WPF. The learning curve is steep, but what amazing things you can do with it!
Look at this hexagon window for instance. Serves no purpose in a business environment …

Software Development
Member Avatar

I'm writing a code that will save the username of a user when a button (in this case button1) gets pressed. I save it to a file called info.txt, and …

Topic by Nether_1

While I'd start by suggesting that you use the .NET file stream options instead, String^ can be converted to std::string using marshal_as if so needed.

Software Development
Member Avatar

I have been trying to compile this code but all my attempts failed, can someone please explain to me what's the meaning of randvar in this code:

int upper_range = …
Topic by chris ig

From the provided code, I can't offer more than

int delete_list_entry(temp_head, randvar);

should be

delete_list_entry(temp_head, randvar);

I get the impression there's a little confusion between how to declare/define functions and …

c++
Software Development
Member Avatar
void change(char* input){
  memset(input, 'a', strlen(input));
}

int main(){
  char* p = "foo";
  cout << p << endl;
  change(p);
  cout << p << endl;
}
Topic by Devon_4

p is a pointer to read-only memory. While some compilers might allow it to be modified, technically what you're doing is undefined behavior. Change line 6 to `char p[] = …

c++
Software Development
Member Avatar

Hi guys,
I wonder if you can help me.
As I’m now doing java development as a profession now, I’ve realized that I’m a little weak when it comes to …

Topic by Violet_82

> I’ve realized that I’m a little weak when it comes to fix, modify and understand code within large applications, and, needless to say, I need to find a way …

Software Development
Member Avatar

Hi,
I want to read csv (Comma Separated Values) file content in VB.Net
I want read entire values in file store in the fixed blocks ( say array )
Please …

Topic by MukeshZ

I'm surprised that nobody has even mentioned the TextFieldParser class in Microsoft.VisualBasic.FileIO... :P

Software Development
Member Avatar

need help with this school project

Topic by Quinton_1

Okay.

c++
Software Development
Member Avatar

Write a program, which will imitate an ATM machine. The program will ask for a password. Assume that only password 123456 is accepted. If the password is correct, display the …

Topic by azeez_2

What have you done so far? Nobody here will write this for you.

c++
Community Center
Member Avatar

Where can I buy a T-shirt with the DaniWeb logo? Or a sticker to pimp up my car? Or is this not feasible?

Topic by ddanbe

I'm a bit surprised you haven't been walking around town handing them out as advertising. There were still a number of big boxes full of shirts after that night, IIRC. …

Programming
Member Avatar

The bad-word filter didn't add the asterisks. I did.

I got passed a link to this "Computer Language" by a parent who asked me if I knew anything about it …

Topic by AssertNull

> Teaching Pascal as a first language in 2017? Really?

Pascal has the benefit of being very easy to understand. It's also hand-holdey, which for most of us translates to …

Software Development
Member Avatar

Consider the following C code snippet:

char *sentence = NULL;
strcpy(sentence, "Helloworld");
printf("%s", sentence); 

is the code segment correct or error.
If correct what is the output?

  1. Error
Topic by Prasad_4

This is clearly a homework or interview question, so please let us know what your thoughts are first.

c
Web Development
Member Avatar

Hello ladies and gents, i hope you are all well! Just recently joined this site looks great and easy to use.

I am just getting into php and msql i …

Software Development
Member Avatar

Would anyone know how to put user input into a Char Array. I've provided the code below
It doesn't work so I've tried many variations like making char wrd as …

Topic by daino

> char array's are actually pointers

This is a common misconception. An array is not a pointer, but when used in value context, the name of an array is converted …

c++
Software Development
Member Avatar

Suppose I'm running a loop and the loop should continue unless I get a garbage value.
So what will be the terminal condition. How can garbage value be checked in …

Topic by MRehanQadri

> is there any pattern to find out garbage value????????

The term "garbage" is meaningless without context. What's garbage for one program could be perfectly valid for another program. So …

c++
Programming
Member Avatar

Hi everyone!, I had this confusion about the the Bucket Sort Algorithm.
I just wanna know why mostly bucket sort use the range of element in between 0 and 1 …

Topic by Dhelandel

Most common domain applications, perhaps? Which examples are you referring to? Bucket sort is certainly not limited to that range, though I can imagine how it's wildly useful.

Web Development
Member Avatar

I would like to show content of a table in SQL database to a gridview in C# project, but there is a trouble, the gridview shows nothing.
could you please …

Topic by nttthuy

Step 1 of troubleshooting is narrowing down the places you need to look. With that in mind, my first question would be whether dt actually contains data or not when …

Software Development
Member Avatar

Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I …

Topic by Brian_22

> zachattack05 : 25 % 2 would return 5

I'm so tempted to write a proof where this actually happens. :D

Software Development
Member Avatar

Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I …

Topic by Brian_22

> ... or use bitwise operator if(i&1) if true even else odd.

I suppose if you want readers of your code to think you're clever, or have legitimately profiled the …

Software Development
Member Avatar
 Try
            Dim cn As New SqlConnection("Data Source=MSR\LOCAL;Initial Catalog=Eventena;Integrated Security=True")
            cn.Open()
            Using cmd As New SqlClient.SqlCommand("INSERT into BirthdayRegistration where Name='" & TextBox4.Text & "',LastName='" & TextBox2.Text & "',Email='" & TextBox5.Text & …
Topic by Baastina

Well, assuming the title of your thread is the problem, I'd ask what a.FileName is and contains. An empty string is indeed not a legal file path, so you want …

Software Development
Member Avatar

Hi,

I am facing an issue in string to const char pointer conversion. I am doing stuff in the fun() but here i am just giving my example. Here it …

Topic by nitin1

> Thus c_str() isn't making a copy of anything, globalPtr is pointing to the same array of characters that abc uses and if you make a change using globalPtr or …

Software Development
Member Avatar

I just started learning how to use pointer array and i'm trying out examples to know more about them but i get confused with them easily. So, I tried to …

Topic by Bryan_5

Let's start by fixing things so the code doesn't break massively from out of range errors:

#include <iostream>
#include <string>

using namespace std;

typedef int* intPtr;

const int MAX = …
Software Development
Member Avatar

I just started learning how to use pointer array and i'm trying out examples to know more about them but i get confused with them easily. So, I tried to …

Topic by Bryan_5

> while (*p != '\0' || *q != '\0')

This is a red flag. Your arrays are not constructed as C-style strings, so '\0' isn't likely to exist within your …

Software Development
Member Avatar

Hi,

I am facing an issue in string to const char pointer conversion. I am doing stuff in the fun() but here i am just giving my example. Here it …

Topic by nitin1

> when fun() returns, it calls the copy constructor again, right?

Ehh, kind of. Return value optimization is a thing, but conceptually it's okay to think of things that way …

Software Development
Member Avatar

Hi,

I am facing an issue in string to const char pointer conversion. I am doing stuff in the fun() but here i am just giving my example. Here it …

Topic by nitin1

> Can you please explain the reason behind this?

You're capturing a direct pointer to the internal storage of the string returned by fun(), which is a temporary object. The …

Community Center
Member Avatar

Assertnull and I have cooked up a little Java utility that we think will be useful for early-stage beginners, and I'm planning to post it for anyone to use.
Is …

Topic by JamesCherrill

> I know that Daniweb owns the I.P.

No. That was unfortunate wording in previous terms of service, and the intention was to absolve Daniweb of legal responsibility for storing …

Programming
Member Avatar

here's my code:

#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
    char name[30], choice;
    int hours_worked;
    float wage;
    do
    {
        cout << "Employee Name: ";
        cin.getline(name,30);
        cout << …
Topic by something_1

I'd strongly recommend walking through your code with a debugger. And my big hint for the problem is that the Enter key places a character in the input stream: '\n'. …

c++
Computer Science
Member Avatar

> I know that the max value for short data type is 32767 and d=2a=2(20000)=40000 that is greater than 32767
> therefore the result of d is in minus d= …

Topic by sunshine102030

> I know that the max value for short data type is 32767

Not necessarily. The C++ standard defines a minimum required range, but compilers are free to make it …

c++
Programming
Member Avatar

Im working on this analyzer program that reads input from a file and breaks characters into various tables.

Ive got the output pretty much done, except there's an issue with …

Topic by catastrophe2

It's not necessary, but generally recommended for classes that implement IDisposable.

Programming
Member Avatar

Im working on this analyzer program that reads input from a file and breaks characters into various tables.

Ive got the output pretty much done, except there's an issue with …

Topic by catastrophe2

Well, for starters the "/ ... /" comment supports multi-line, so you'll need to consider that in your parsing. A simple approach would be a loop that reads and throws …